📄 formmenu1.frm
字号:
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 Command21
Height = 495
Left = 5160
TabIndex = 16
Top = 3240
Width = 615
End
Begin VB.CommandButton Command22
Height = 495
Left = 5760
TabIndex = 15
Top = 3480
Width = 615
End
Begin VB.CommandButton Command23
Height = 495
Left = 5160
TabIndex = 14
Top = 3720
Width = 615
End
Begin VB.CommandButton Command24
Height = 495
Left = 4560
TabIndex = 13
Top = 3480
Width = 615
End
Begin VB.CommandButton Command25
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 = "FormMenu1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Locflag用于记录菜单界面的情况
Public Locflag As String
'TextIndex记录当前Text框的获取Focus的情况
Dim TextIndex As Integer
Private Sub Form_Load()
Dim iniPathName As String
iniPathName = App.Path + "\App\Corrd_Survey.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")
For i = 0 To 3
Me.Label1(i).Visible = False
Me.Label1(i).BackStyle = 1
Next
Locflag = "坐标测量1"
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)
'先判断当前处于哪个界面
'再判断当前按下什么按钮
If Locflag = "坐标测量1" Then
'KeyCode为38,说明为按了向上的按钮
If KeyCode = 38 Then
If Index > 1 Then
Beep
Text1(Index - 1).SetFocus
ElseIf Index = 1 Then
Beep
Me.Text1(3).SetFocus
End If
'KeyCode为40,说明为按了向下的按钮
ElseIf KeyCode = 40 Then
If Index < 3 Then
Beep
Text1(Index + 1).SetFocus
ElseIf Index = 3 Then
Beep
Me.Text1(1).SetFocus
End If
'KeyCode为13,说明为按了回车的按钮
ElseIf KeyCode = 13 Then
'判断是哪一种,再调用各个不同的测量界面
Select Case Trim(Text1(Index).Text)
Case "测 站 定 向"
Beep
Call LoadPage("坐标测量1", True)
Case "测 量"
Case "EDM"
End Select
'KeyCode为8,说明按了BackSpace按钮
ElseIf KeyCode = 8 Then
End If
ElseIf Locflag = "坐标测量2" Then
End If
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &HFFFFFF
Text1(Index).ForeColor = &H0&
End Sub
'控制菜单流程
Private Sub LoadPage(ByVal PageName As String, ByVal Flag As Boolean)
'通过PageName的参数的不同,调不同的显示界面
'通过Flag的不同,flase表示后退,true表示前进
Dim iniPathName As String
Select Case PageName
Case "坐标测量1"
If Flag = False Then
iniPathName = App.Path + "\App\Corrd_Survey.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")
For i = 0 To 3
Me.Label1(i).Visible = False
Me.Label1(i).BackStyle = 1
Next
Locflag = "坐标测量1"
ElseIf Flag = True Then
iniPathName = App.Path + "\App\Corrd_Survey.ini"
Me.Text1(0).Text = GetProfile(iniPathName, "测站定向", "Text0")
Me.Text1(1).Text = GetProfile(iniPathName, "测站定向", "Text1")
Me.Text1(2).Text = GetProfile(iniPathName, "测站定向", "Text2")
For i = 0 To 3
Me.Label1(i).Visible = False
Me.Label1(i).BackStyle = 1
Next
Locflag = "坐标测量1"
End If
Case "坐标测量2"
If Flag = False Then
ElseIf Flag = True Then
End If
End Select
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"
Me.Text1(0).Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -