📄 formmenu.frm
字号:
Index = 2
Left = 2040
TabIndex = 39
Top = 1920
Width = 735
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00000000&
BeginProperty Font
Name = "Times New Roman"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Index = 3
Left = 3000
TabIndex = 38
Top = 1920
Width = 735
End
End
Begin VB.CommandButton Command1
Height = 255
Left = 4320
TabIndex = 36
Top = 720
Width = 495
End
Begin VB.CommandButton Command2
Height = 255
Left = 4320
TabIndex = 35
Top = 1200
Width = 495
End
Begin VB.CommandButton Command3
Height = 255
Left = 4320
TabIndex = 34
Top = 1680
Width = 495
End
Begin VB.CommandButton Command4
Height = 255
Left = 4320
TabIndex = 33
Top = 2160
Width = 495
End
Begin VB.CommandButton Command5
Height = 255
Left = 360
TabIndex = 32
Top = 3480
Width = 735
End
Begin VB.CommandButton Command6
Height = 255
Left = 1320
TabIndex = 31
Top = 3480
Width = 735
End
Begin VB.CommandButton Command7
Height = 255
Left = 2280
TabIndex = 30
Top = 3480
Width = 735
End
Begin VB.CommandButton Command8
Height = 255
Left = 3240
TabIndex = 29
Top = 3480
Width = 735
End
Begin VB.CommandButton Command9
Height = 255
Left = 5040
TabIndex = 28
Top = 720
Width = 375
End
Begin VB.CommandButton Command10
Height = 255
Left = 5520
TabIndex = 27
Top = 720
Width = 375
End
Begin VB.CommandButton Command11
Height = 255
Left = 6000
TabIndex = 26
Top = 720
Width = 375
End
Begin VB.CommandButton Command12
Height = 255
Left = 5040
TabIndex = 25
Top = 1200
Width = 375
End
Begin VB.CommandButton Command13
Height = 255
Left = 5520
TabIndex = 24
Top = 1200
Width = 375
End
Begin VB.CommandButton Command14
Height = 255
Left = 6000
TabIndex = 23
Top = 1200
Width = 375
End
Begin VB.CommandButton Command15
Height = 255
Left = 5040
TabIndex = 22
Top = 1680
Width = 375
End
Begin VB.CommandButton Command16
Height = 255
Left = 5520
TabIndex = 21
Top = 1680
Width = 375
End
Begin VB.CommandButton Command17
Height = 255
Left = 6000
TabIndex = 20
Top = 1680
Width = 375
End
Begin VB.CommandButton Command18
Height = 255
Left = 5040
TabIndex = 19
Top = 2160
Width = 375
End
Begin VB.CommandButton Command19
Height = 255
Left = 5520
TabIndex = 18
Top = 2160
Width = 375
End
Begin VB.CommandButton Command20
Height = 255
Left = 6000
TabIndex = 17
Top = 2160
Width = 375
End
Begin VB.CommandButton CmdUp
Height = 495
Left = 5160
TabIndex = 16
Top = 3240
Width = 615
End
Begin VB.CommandButton CmdRight
Height = 495
Left = 5760
TabIndex = 15
Top = 3480
Width = 615
End
Begin VB.CommandButton CmdDown
Height = 495
Left = 5160
TabIndex = 14
Top = 3720
Width = 615
End
Begin VB.CommandButton CmdLeft
Height = 495
Left = 4560
TabIndex = 13
Top = 3480
Width = 615
End
Begin VB.CommandButton CmdEnter
Height = 495
Left = 3600
TabIndex = 12
Top = 3840
Width = 735
End
Begin VB.CommandButton Command26
Height = 375
Left = 720
TabIndex = 11
Top = 3960
Width = 735
End
Begin VB.CommandButton Command27
Height = 375
Left = 1680
TabIndex = 10
Top = 3960
Width = 735
End
Begin VB.CommandButton Command28
Height = 375
Left = 2640
TabIndex = 9
Top = 3960
Width = 735
End
Begin VB.CommandButton Command29
Height = 255
Left = 4320
TabIndex = 8
Top = 2640
Width = 495
End
Begin VB.CommandButton Command30
Height = 255
Left = 240
TabIndex = 7
Top = 360
Width = 255
End
Begin VB.CommandButton Command31
Height = 255
Left = 600
TabIndex = 6
Top = 360
Width = 615
End
End
End
Attribute VB_Name = "FormMenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Locflag用于记录菜单界面的情况
Dim Locflag As String
'TextIndex记录当前Text框的获取Focus的情况
Dim TextIndex As Integer
'向上按钮
Private Sub CmdUp_Click()
Call Text1_KeyDown(TextIndex, 38, 0)
End Sub
'向下按钮
Private Sub CmdDown_Click()
Call Text1_KeyDown(TextIndex, 40, 0)
End Sub
'回车按钮
Private Sub CmdEnter_Click()
Call Text1_KeyDown(TextIndex, 13, 0)
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &H0&
Text1(Index).ForeColor = &HFFFFFF
TextIndex = Index
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
MsgBox KeyCode
If Locflag = "常用菜单1" Then
'KeyCode为38,说明为按了向上的按钮
If KeyCode = 38 Then
If Index > 1 Then
Beep
Text1(Index - 1).SetFocus
ElseIf Index = 1 Then
Beep
Call NextPage
Me.Text1(5).SetFocus
End If
'KeyCode为40,说明为按了向下的按钮
ElseIf KeyCode = 40 Then
If Index < 5 Then
Beep
Text1(Index + 1).SetFocus
ElseIf Index = 5 Then
Beep
Call NextPage
Me.Text1(0).SetFocus
End If
'KeyCode为8,说明按了BackSpace按钮
ElseIf KeyCode = 8 Then
End If
ElseIf Locflag = "常用菜单2" Then
'KeyCode为38,说明为按了向上的按钮
If KeyCode = 38 Then
If Index > 0 Then
Beep
Text1(Index - 1).SetFocus
ElseIf Index = 0 Then
Beep
Call PrvPage
Me.Text1(5).SetFocus
End If
'KeyCode为40,说明为按了向下的按钮
ElseIf KeyCode = 40 Then
If Index < 5 Then
Beep
Text1(Index + 1).SetFocus
ElseIf Index = 5 Then
Beep
Call PrvPage
Me.Text1(1).SetFocus
End If
End If
'KeyCode为8,说明按了BackSpace按钮
ElseIf KeyCode = 8 Then
End If
End If
'KeyCode为13,说明为按了回车的按钮
If KeyCode = 13 Then
'判断是哪一种,再调用各个不同的测量界面
Select Case Trim(Text1(Index).Text)
Case "坐 标 测 量"
Beep
FormMenu1.Show
Unload FormMenu
Case "放 样 测 量"
Case "偏 心 测 量"
Case "重 复 测 量"
Case "对 边 测 量"
Case "悬 高 测 量"
Case "后 交 测 量"
Case "面 积 计 算"
Case "直 线 放 样"
Case "点 投 影"
Case "线 路 计 算"
End Select
End If
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &HFFFFFF
Text1(Index).ForeColor = &H0&
End Sub
'回到菜单前页
Private Sub PrvPage()
Dim iniPathName As String
iniPathName = App.Path + "\App\Menu.ini"
Me.Text1(0).Text = GetProfile(iniPathName, "常用菜单1", "Text0")
Me.Text1(1).Text = GetProfile(iniPathName, "常用菜单1", "Text1")
Me.Text1(2).Text = GetProfile(iniPathName, "常用菜单1", "Text2")
Me.Text1(3).Text = GetProfile(iniPathName, "常用菜单1", "Text3")
Me.Text1(4).Text = GetProfile(iniPathName, "常用菜单1", "Text4")
Me.Text1(5).Text = GetProfile(iniPathName, "常用菜单1", "Text5")
For i = 0 To 3
Me.Label1(i).Visible = False
Me.Label1(i).BackStyle = 1
Next
Locflag = "常用菜单1"
End Sub
'回到菜单后页
Private Sub NextPage()
Dim iniPathName As String
iniPathName = App.Path + "\App\Menu.ini"
Me.Text1(0).Text = GetProfile(iniPathName, "常用菜单2", "Text0")
Me.Text1(1).Text = GetProfile(iniPathName, "常用菜单2", "Text1")
Me.Text1(2).Text = GetProfile(iniPathName, "常用菜单2", "Text2")
Me.Text1(3).Text = GetProfile(iniPathName, "常用菜单2", "Text3")
Me.Text1(4).Text = GetProfile(iniPathName, "常用菜单2", "Text4")
Me.Text1(5).Text = GetProfile(iniPathName, "常用菜单2", "Text5")
For i = 0 To 3
Me.Label1(i).Visible = False
Me.Label1(i).BackStyle = 1
Next
Locflag = "常用菜单2"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -