📄 frmoptions.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmOptions
BorderStyle = 3 'Fixed Dialog
Caption = "选项"
ClientHeight = 4035
ClientLeft = 45
ClientTop = 330
ClientWidth = 5100
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4035
ScaleWidth = 5100
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Tag = "选项"
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 375
Left = 1560
TabIndex = 1
Tag = "确定"
Top = 3600
Width = 1095
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 3
Tag = "取消"
Top = 3600
Width = 1095
End
Begin VB.CommandButton cmdApply
Caption = "应用(&A)"
Height = 375
Left = 3960
TabIndex = 4
Tag = "应用(&A)"
Top = 3600
Width = 1095
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 3780
Index = 3
Left = -20000
ScaleHeight = 3840.968
ScaleMode = 0 'User
ScaleWidth = 5745.64
TabIndex = 6
TabStop = 0 'False
Top = 480
Width = 5685
Begin VB.Frame fraSample4
Caption = "示例 4"
Height = 2022
Left = 505
TabIndex = 7
Tag = "示例 4"
Top = 502
Width = 2033
End
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 3780
Index = 2
Left = -20000
ScaleHeight = 3840.968
ScaleMode = 0 'User
ScaleWidth = 5745.64
TabIndex = 8
TabStop = 0 'False
Top = 480
Width = 5685
Begin VB.Frame fraSample3
Caption = "示例 3"
Height = 2022
Left = 406
TabIndex = 9
Tag = "示例 3"
Top = 403
Width = 2033
End
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 3780
Index = 1
Left = -20000
ScaleHeight = 3840.968
ScaleMode = 0 'User
ScaleWidth = 5745.64
TabIndex = 5
TabStop = 0 'False
Top = 480
Width = 5685
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 2940
Index = 0
Left = 240
ScaleHeight = 2987.419
ScaleMode = 0 'User
ScaleWidth = 4654.12
TabIndex = 2
TabStop = 0 'False
Top = 480
Width = 4605
End
Begin MSComctlLib.TabStrip tbsOptions
Height = 3405
Left = 105
TabIndex = 0
Top = 120
Width = 4935
_ExtentX = 8705
_ExtentY = 6006
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "数据库设置"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "颜色方案"
ImageVarType = 2
EndProperty
EndProperty
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 600
Top = 3480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
End
Attribute VB_Name = "frmOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdApply_Click()
'ToDo: 添加 'cmdApply_Click' 代码
MsgBox "此处添加代码,设置选项无需关闭对话框!"
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'ToDo: 添加 'cmdOK_Click' 代码
MsgBox "此处添加代码,设置选项并关闭对话框!"
Unload Me
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim I As Integer
I = tbsOptions.SelectedItem.Index
'处理 ctrl+tab 移到下一 tab
If (Shift And 3) = 2 And KeyCode = vbKeyTab Then
If I = tbsOptions.Tabs.Count Then
'已是最后的 tab 所以需要折回到 tab 1
Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
Else
'递增 tab
Set tbsOptions.SelectedItem = tbsOptions.Tabs(I + 1)
End If
ElseIf (Shift And 3) = 3 And KeyCode = vbKeyTab Then
If I = 1 Then
'已是最后的 tab 所以需要折回到 tab 1
Set tbsOptions.SelectedItem = tbsOptions.Tabs(tbsOptions.Tabs.Count)
Else
'递增 tab
Set tbsOptions.SelectedItem = tbsOptions.Tabs(I - 1)
End If
End If
End Sub
Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2, Me.Width, Me.Height
End Sub
Private Sub tbsOptions_Click()
Dim I As Integer
'显示并使选定选项卡的控件生效,隐含并禁止其他的
For I = 0 To tbsOptions.Tabs.Count - 1
If I = tbsOptions.SelectedItem.Index - 1 Then
picOptions(I).Left = 210
picOptions(I).Enabled = True
Else
picOptions(I).Left = -20000
picOptions(I).Enabled = False
End If
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -