📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 5475
ClientLeft = 2475
ClientTop = 1095
ClientWidth = 4605
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5475
ScaleWidth = 4605
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command5
Caption = "返回(&C)"
Height = 375
Left = 3600
TabIndex = 37
Top = 960
Width = 855
End
Begin VB.CommandButton Command2
Caption = "检测水果"
Height = 495
Left = 3240
TabIndex = 36
Top = 1800
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "查看颜色代码"
Height = 375
Left = 360
TabIndex = 30
Top = 960
Visible = 0 'False
Width = 1335
End
Begin VB.Frame Frame2
Caption = "已设置的数据"
Height = 3735
Left = 0
TabIndex = 1
Top = 1560
Width = 4575
Begin VB.CommandButton Command4
Caption = "清空数据"
Height = 495
Left = 3240
TabIndex = 32
Top = 840
Visible = 0 'False
Width = 1215
End
Begin VB.TextBox Text2
Height = 270
Index = 7
Left = 2040
TabIndex = 27
Top = 3240
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 6
Left = 2040
TabIndex = 26
Top = 840
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 5
Left = 2040
TabIndex = 25
Top = 1920
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 4
Left = 2040
TabIndex = 24
Top = 2520
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 2
Left = 2040
TabIndex = 23
Top = 1200
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 0
Left = 2040
TabIndex = 22
Top = 480
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 3
Left = 2040
TabIndex = 21
Top = 1560
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Index = 1
Left = 2040
TabIndex = 20
Top = 2880
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 7
Left = 960
TabIndex = 19
Top = 3240
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 6
Left = 960
TabIndex = 18
Top = 840
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 5
Left = 960
TabIndex = 17
Top = 1920
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 4
Left = 960
TabIndex = 16
Top = 2520
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 3
Left = 960
TabIndex = 15
Top = 1560
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 2
Left = 960
TabIndex = 14
Top = 1200
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 1
Left = 960
TabIndex = 13
Top = 2880
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 0
Left = 960
TabIndex = 4
Top = 480
Width = 1095
End
Begin VB.Label Label4
Caption = "玩5种水果的要保证前5种水果设置完成; 玩8种水果的要保证全部8种水果都设置完成。"
Height = 1575
Left = 3240
TabIndex = 33
Top = 1680
Width = 1215
End
Begin VB.Label Label13
Caption = "黄色香蕉"
Height = 255
Left = 120
TabIndex = 12
Top = 3240
Width = 855
End
Begin VB.Label Label12
Caption = "绿色茄子"
Height = 255
Left = 120
TabIndex = 11
Top = 840
Width = 855
End
Begin VB.Label Label11
Caption = "红色草莓"
Height = 255
Left = 120
TabIndex = 10
Top = 1920
Width = 855
End
Begin VB.Label Label10
Caption = "紫色葡萄"
Height = 255
Left = 120
TabIndex = 9
Top = 2520
Width = 855
End
Begin VB.Label Label9
Caption = "蓝色葡萄"
Height = 255
Left = 120
TabIndex = 8
Top = 1560
Width = 855
End
Begin VB.Label Label7
Caption = "绿色西瓜"
Height = 255
Left = 120
TabIndex = 7
Top = 1200
Width = 855
End
Begin VB.Label Label3
Caption = "红色苹果"
Height = 255
Left = 120
TabIndex = 6
Top = 2880
Width = 855
End
Begin VB.Label Label6
Caption = "颜色代码"
Height = 255
Left = 960
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.Label Label5
Caption = "粉红桃子"
Height = 255
Left = 120
TabIndex = 2
Top = 480
Width = 855
End
End
Begin VB.Frame Frame1
Caption = "设置水果"
Height = 1335
Left = 0
TabIndex = 0
Top = 120
Width = 4575
Begin VB.ComboBox Combo1
Height = 300
Index = 2
ItemData = "Form1.frx":08CA
Left = 3120
List = "Form1.frx":08E9
Style = 2 'Dropdown List
TabIndex = 35
Top = 480
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Index = 1
ItemData = "Form1.frx":0945
Left = 1920
List = "Form1.frx":0964
Style = 2 'Dropdown List
TabIndex = 34
Top = 480
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Index = 0
ItemData = "Form1.frx":09C0
Left = 720
List = "Form1.frx":09DF
Style = 2 'Dropdown List
TabIndex = 28
Top = 480
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "设置水果(&O)"
Height = 375
Left = 2160
TabIndex = 5
Top = 840
Width = 1335
End
Begin VB.Label Label2
Caption = "第1列 第2列 第3列"
Height = 255
Left = 720
TabIndex = 31
Top = 240
Width = 3615
End
Begin VB.Label Label1
Caption = "第1行"
Height = 255
Left = 120
TabIndex = 29
Top = 480
Width = 615
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo5_Change()
End Sub
Private Sub Command1_Click()
j2 = 0
For k = 0 To 2
If Combo1(i).Text = "请选择" Then j2 = j2 + 1
Next
getBoxs
WriteIniStr Combo1(0).Text, "x", getColor(boxs(0, 0).x, boxs(0, 0).y)
WriteIniStr Combo1(0).Text, "y", getColor(boxs(0, 0).x, boxs(0, 0).y - 5)
WriteIniStr Combo1(1).Text, "x", getColor(boxs(0, 1).x, boxs(0, 1).y)
WriteIniStr Combo1(1).Text, "y", getColor(boxs(0, 1).x, boxs(0, 1).y - 5)
WriteIniStr Combo1(2).Text, "x", getColor(boxs(0, 2).x, boxs(0, 2).y)
WriteIniStr Combo1(2).Text, "y", getColor(boxs(0, 2).x, boxs(0, 2).y - 5)
If j2 > 0 Then
MsgBox "有" & j & "个位置未选择,请选择!"
Else
MsgBox "设置成功!"
'读取ini中已有的各水果信息
Text1(0).Text = GetIniStr("粉红桃子", "x")
Text1(1).Text = GetIniStr("红色苹果", "x")
Text1(2).Text = GetIniStr("绿色西瓜", "x")
Text1(3).Text = GetIniStr("蓝色葡萄", "x")
Text1(4).Text = GetIniStr("紫色葡萄", "x")
Text1(5).Text = GetIniStr("红色草莓", "x")
Text1(6).Text = GetIniStr("绿色茄子", "x")
Text1(7).Text = GetIniStr("黄色香蕉", "x")
Text2(0).Text = GetIniStr("粉红桃子", "y")
Text2(1).Text = GetIniStr("红色苹果", "y")
Text2(2).Text = GetIniStr("绿色西瓜", "y")
Text2(3).Text = GetIniStr("蓝色葡萄", "y")
Text2(4).Text = GetIniStr("紫色葡萄", "y")
Text2(5).Text = GetIniStr("红色草莓", "y")
Text2(6).Text = GetIniStr("绿色茄子", "y")
Text2(7).Text = GetIniStr("黄色香蕉", "y")
shuiguox(0) = GetIniStr("粉红桃子", "x")
shuiguox(1) = GetIniStr("红色苹果", "x")
shuiguox(2) = GetIniStr("绿色西瓜", "x")
shuiguox(3) = GetIniStr("蓝色葡萄", "x")
shuiguox(4) = GetIniStr("紫色葡萄", "x")
shuiguox(5) = GetIniStr("红色草莓", "x")
shuiguox(6) = GetIniStr("绿色茄子", "x")
shuiguox(7) = GetIniStr("黄色香蕉", "x")
shuiguoy(0) = GetIniStr("粉红桃子", "y")
shuiguoy(1) = GetIniStr("红色苹果", "y")
shuiguoy(2) = GetIniStr("绿色西瓜", "y")
shuiguoy(3) = GetIniStr("蓝色葡萄", "y")
shuiguoy(4) = GetIniStr("紫色葡萄", "y")
shuiguoy(5) = GetIniStr("红色草莓", "y")
shuiguoy(6) = GetIniStr("绿色茄子", "y")
shuiguoy(7) = GetIniStr("黄色香蕉", "y")
End If
End Sub
Private Sub Command2_Click()
Form3.Show
End Sub
Private Sub Command3_Click()
Form2.Show
getBoxs
For i = 0 To 7
Form2.Text4.Text = Form2.Text4.Text & " | " & getColor(boxs(0, i).x, boxs(0, i).y) & "," & getColor(boxs(0, i).x, boxs(0, i).y - 5)
Next
End Sub
Private Sub Command4_Click()
For i = 0 To 7
Text1(i).Text = ""
Text2(i).Text = ""
Next
End Sub
Private Sub Command5_Click()
Me.Hide
frm_main.Show
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
frm_main.Show
End Sub
Private Sub Form_Load()
Form1.Caption = ">>设置<< " & frm_main.Caption
For i = 0 To 2
Combo1(i).Text = "请选择"
Next
Text1(0).Text = GetIniStr("粉红桃子", "x")
Text1(2).Text = GetIniStr("绿色西瓜", "x")
Text1(3).Text = GetIniStr("蓝色葡萄", "x")
Text1(5).Text = GetIniStr("红色草莓", "x")
Text1(6).Text = GetIniStr("绿色茄子", "x")
Text1(4).Text = GetIniStr("紫色葡萄", "x")
Text1(1).Text = GetIniStr("红色苹果", "x")
Text1(7).Text = GetIniStr("黄色香蕉", "x")
Text2(0).Text = GetIniStr("粉红桃子", "y")
Text2(2).Text = GetIniStr("绿色西瓜", "y")
Text2(3).Text = GetIniStr("蓝色葡萄", "y")
Text2(5).Text = GetIniStr("红色草莓", "y")
Text2(6).Text = GetIniStr("绿色茄子", "y")
Text2(1).Text = GetIniStr("红色苹果", "y")
Text2(4).Text = GetIniStr("紫色葡萄", "y")
Text2(7).Text = GetIniStr("黄色香蕉", "y")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -