frmOptions.frm
上传用户:salesll
上传日期:2014-07-25
资源大小:2665k
文件大小:7k
源码类别:

交通/航空行业

开发平台:

Others

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmOptions 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "选项"
  6.    ClientHeight    =   4965
  7.    ClientLeft      =   45
  8.    ClientTop       =   405
  9.    ClientWidth     =   6150
  10.    KeyPreview      =   -1  'True
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4965
  15.    ScaleWidth      =   6150
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   1  '所有者中心
  18.    Tag             =   "选项"
  19.    Begin VB.CommandButton cmdOK 
  20.       Caption         =   "确定"
  21.       Height          =   375
  22.       Left            =   2490
  23.       TabIndex        =   1
  24.       Tag             =   "确定"
  25.       Top             =   4455
  26.       Width           =   1095
  27.    End
  28.    Begin VB.CommandButton cmdCancel 
  29.       Cancel          =   -1  'True
  30.       Caption         =   "取消"
  31.       Height          =   375
  32.       Left            =   3720
  33.       TabIndex        =   3
  34.       Tag             =   "取消"
  35.       Top             =   4455
  36.       Width           =   1095
  37.    End
  38.    Begin VB.CommandButton cmdApply 
  39.       Caption         =   "应用(&A)"
  40.       Height          =   375
  41.       Left            =   4920
  42.       TabIndex        =   5
  43.       Tag             =   "应用(&A)"
  44.       Top             =   4455
  45.       Width           =   1095
  46.    End
  47.    Begin VB.PictureBox picOptions 
  48.       BorderStyle     =   0  'None
  49.       Height          =   3780
  50.       Index           =   3
  51.       Left            =   -20000
  52.       ScaleHeight     =   3840.968
  53.       ScaleMode       =   0  'User
  54.       ScaleWidth      =   5745.64
  55.       TabIndex        =   7
  56.       TabStop         =   0   'False
  57.       Top             =   480
  58.       Width           =   5685
  59.       Begin VB.Frame fraSample4 
  60.          Caption         =   "示例 4"
  61.          Height          =   2022
  62.          Left            =   505
  63.          TabIndex        =   11
  64.          Tag             =   "示例 4"
  65.          Top             =   502
  66.          Width           =   2033
  67.       End
  68.    End
  69.    Begin VB.PictureBox picOptions 
  70.       BorderStyle     =   0  'None
  71.       Height          =   3780
  72.       Index           =   2
  73.       Left            =   -20000
  74.       ScaleHeight     =   3840.968
  75.       ScaleMode       =   0  'User
  76.       ScaleWidth      =   5745.64
  77.       TabIndex        =   9
  78.       TabStop         =   0   'False
  79.       Top             =   480
  80.       Width           =   5685
  81.       Begin VB.Frame fraSample3 
  82.          Caption         =   "示例 3"
  83.          Height          =   2022
  84.          Left            =   406
  85.          TabIndex        =   10
  86.          Tag             =   "示例 3"
  87.          Top             =   403
  88.          Width           =   2033
  89.       End
  90.    End
  91.    Begin VB.PictureBox picOptions 
  92.       BorderStyle     =   0  'None
  93.       Height          =   3780
  94.       Index           =   1
  95.       Left            =   -20000
  96.       ScaleHeight     =   3840.968
  97.       ScaleMode       =   0  'User
  98.       ScaleWidth      =   5745.64
  99.       TabIndex        =   6
  100.       TabStop         =   0   'False
  101.       Top             =   480
  102.       Width           =   5685
  103.       Begin VB.Frame fraSample2 
  104.          Caption         =   "示例 2"
  105.          Height          =   2022
  106.          Left            =   307
  107.          TabIndex        =   8
  108.          Tag             =   "示例 2"
  109.          Top             =   305
  110.          Width           =   2033
  111.       End
  112.    End
  113.    Begin VB.PictureBox picOptions 
  114.       BorderStyle     =   0  'None
  115.       Height          =   3780
  116.       Index           =   0
  117.       Left            =   210
  118.       ScaleHeight     =   3840.968
  119.       ScaleMode       =   0  'User
  120.       ScaleWidth      =   5745.64
  121.       TabIndex        =   2
  122.       TabStop         =   0   'False
  123.       Top             =   480
  124.       Width           =   5685
  125.       Begin VB.Frame fraSample1 
  126.          Caption         =   "示例 1"
  127.          Height          =   2022
  128.          Left            =   208
  129.          TabIndex        =   4
  130.          Tag             =   "示例 1"
  131.          Top             =   207
  132.          Width           =   2033
  133.       End
  134.    End
  135.    Begin MSComctlLib.TabStrip tbsOptions 
  136.       Height          =   4245
  137.       Left            =   120
  138.       TabIndex        =   0
  139.       Top             =   120
  140.       Width           =   5895
  141.       _ExtentX        =   10398
  142.       _ExtentY        =   7488
  143.       _Version        =   393216
  144.       BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
  145.          NumTabs         =   4
  146.          BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  147.             Caption         =   "组 1"
  148.             ImageVarType    =   2
  149.          EndProperty
  150.          BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  151.             Caption         =   "组 2"
  152.             ImageVarType    =   2
  153.          EndProperty
  154.          BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  155.             Caption         =   "组 3"
  156.             ImageVarType    =   2
  157.          EndProperty
  158.          BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
  159.             Caption         =   "组 4"
  160.             ImageVarType    =   2
  161.          EndProperty
  162.       EndProperty
  163.    End
  164. End
  165. Attribute VB_Name = "frmOptions"
  166. Attribute VB_GlobalNameSpace = False
  167. Attribute VB_Creatable = False
  168. Attribute VB_PredeclaredId = True
  169. Attribute VB_Exposed = False
  170. Private Sub cmdApply_Click()
  171.     'ToDo: 添加 'cmdApply_Click' 代码
  172.     MsgBox "此处添加代码,设置选项无需关闭对话框!"
  173. End Sub
  174. Private Sub cmdCancel_Click()
  175.     Unload Me
  176. End Sub
  177. Private Sub cmdOK_Click()
  178.     'ToDo: 添加 'cmdOK_Click' 代码
  179.     MsgBox "此处添加代码,设置选项并关闭对话框!"
  180.     Unload Me
  181. End Sub
  182. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  183.     Dim i As Integer
  184.     i = tbsOptions.SelectedItem.Index
  185.     '处理 ctrl+tab 移到下一 tab
  186.     If (Shift And 3) = 2 And KeyCode = vbKeyTab Then
  187.         If i = tbsOptions.Tabs.Count Then
  188.             '已是最后的 tab 所以需要折回到 tab 1
  189.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
  190.         Else
  191.             '递增 tab
  192.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(i + 1)
  193.         End If
  194.     ElseIf (Shift And 3) = 3 And KeyCode = vbKeyTab Then
  195.         If i = 1 Then
  196.             '已是最后的 tab 所以需要折回到 tab 1
  197.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(tbsOptions.Tabs.Count)
  198.         Else
  199.             '递增 tab
  200.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(i - 1)
  201.         End If
  202.     End If
  203. End Sub
  204. Private Sub tbsOptions_Click()
  205.     
  206.     Dim i As Integer
  207.     '显示并使选定选项卡的控件生效,隐含并禁止其他的
  208.     For i = 0 To tbsOptions.Tabs.Count - 1
  209.         If i = tbsOptions.SelectedItem.Index - 1 Then
  210.             picOptions(i).Left = 210
  211.             picOptions(i).Enabled = True
  212.         Else
  213.             picOptions(i).Left = -20000
  214.             picOptions(i).Enabled = False
  215.         End If
  216.     Next
  217.     
  218. End Sub