⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 一个智力游戏
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "点灯游戏"
   ClientHeight    =   5280
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   6375
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   5280
   ScaleWidth      =   6375
   StartUpPosition =   3  'Windows Default
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   4935
      Left            =   0
      ScaleHeight     =   4905
      ScaleWidth      =   6345
      TabIndex        =   0
      Top             =   240
      Width           =   6375
      Begin MSComDlg.CommonDialog CommonDialog1 
         Left            =   2520
         Top             =   360
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
   End
   Begin VB.Menu game 
      Caption         =   "游戏"
      Begin VB.Menu set 
         Caption         =   "设置"
         Begin VB.Menu bk_color 
            Caption         =   "背景颜色"
         End
         Begin VB.Menu hit_color 
            Caption         =   "方格线颜色"
         End
      End
   End
   Begin VB.Menu help1 
      Caption         =   "帮助"
      Begin VB.Menu how_playgame 
         Caption         =   "游戏规则"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Sub fill_color(x, y)
  If Picture1.Point(x, y) = RGB(0, 0, 0) Then
     Picture1.Line (x - 0.5, y + 0.5)-(x + 0.5, y - 0.5), RGB(250, 250, 250), BF
  Else
    Picture1.Line (x - 0.5, y + 0.5)-(x + 0.5, y - 0.5), RGB(0, 0, 0), BF
  End If
End Sub

Private Sub bk_color_Click()
CommonDialog1.ShowColor
Picture1.BackColor = CommonDialog1.Color
Form_Resize
End Sub

Private Sub Form_Load()
Picture1.Scale (0, 12)-(12, 0)
End Sub

Private Sub Form_Resize()
Dim i As Integer
For i = 1 To 11
  Picture1.Line (1, i)-(11, i)
  Picture1.Line (i, 1)-(i, 11)
  Next i
End Sub



Private Sub hit_color_Click()
CommonDialog1.ShowColor
Picture1.ForeColor = CommonDialog1.Color
Form_Resize
End Sub

Private Sub how_playgame_Click()
Form2.Show
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Int(x) >= 1 And Int(x) < 11 And Int(y) >= 1 And Int(y) < 11 Then
   fill_color Int(x) + 0.5, Int(y) + 0.5
   If Int(y) + 1 <= 10 Then fill_color Int(x) + 0.5, Int(y) + 1.5
   If Int(y) - 1 >= 1 Then fill_color Int(x) + 0.5, Int(y) - 0.5
   If Int(x) + 1 <= 10 Then fill_color Int(x) + 1.5, Int(y) + 0.5
   If Int(x) - 1 >= 1 Then fill_color Int(x) - 0.5, Int(y) + 0.5
   Form_Resize
End If
   
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -