frmOption.frm
上传用户:djzm888
上传日期:2013-02-15
资源大小:867k
文件大小:17k
源码类别:

其他数据库

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmOption 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "选项"
  6.    ClientHeight    =   4890
  7.    ClientLeft      =   2565
  8.    ClientTop       =   1500
  9.    ClientWidth     =   6150
  10.    Icon            =   "frmOption.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4890
  17.    ScaleWidth      =   6150
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  'CenterScreen
  20.    Begin VB.PictureBox picOptions 
  21.       BorderStyle     =   0  'None
  22.       Height          =   3780
  23.       Index           =   3
  24.       Left            =   -20000
  25.       ScaleHeight     =   3780
  26.       ScaleWidth      =   5685
  27.       TabIndex        =   14
  28.       TabStop         =   0   'False
  29.       Top             =   480
  30.       Width           =   5685
  31.       Begin VB.Frame fraSample4 
  32.          Caption         =   "示例 4"
  33.          Height          =   1785
  34.          Left            =   2100
  35.          TabIndex        =   17
  36.          Top             =   840
  37.          Width           =   2055
  38.       End
  39.    End
  40.    Begin VB.PictureBox picOptions 
  41.       BorderStyle     =   0  'None
  42.       Height          =   3780
  43.       Index           =   2
  44.       Left            =   -20000
  45.       ScaleHeight     =   3780
  46.       ScaleWidth      =   5685
  47.       TabIndex        =   13
  48.       TabStop         =   0   'False
  49.       Top             =   480
  50.       Width           =   5685
  51.       Begin VB.Frame fraSample3 
  52.          Caption         =   "示例 3"
  53.          Height          =   1785
  54.          Left            =   1545
  55.          TabIndex        =   16
  56.          Top             =   675
  57.          Width           =   2055
  58.       End
  59.    End
  60.    Begin VB.PictureBox picOptions 
  61.       BorderStyle     =   0  'None
  62.       Height          =   3780
  63.       Index           =   1
  64.       Left            =   -20000
  65.       ScaleHeight     =   3780
  66.       ScaleWidth      =   5685
  67.       TabIndex        =   12
  68.       TabStop         =   0   'False
  69.       Top             =   480
  70.       Width           =   5685
  71.       Begin VB.Frame fraSample2 
  72.          Caption         =   "示例 2"
  73.          Height          =   1785
  74.          Left            =   645
  75.          TabIndex        =   15
  76.          Top             =   300
  77.          Width           =   2055
  78.       End
  79.    End
  80.    Begin VB.PictureBox picOptions 
  81.       BorderStyle     =   0  'None
  82.       Height          =   3465
  83.       Index           =   0
  84.       Left            =   195
  85.       ScaleHeight     =   3465
  86.       ScaleWidth      =   5685
  87.       TabIndex        =   10
  88.       TabStop         =   0   'False
  89.       Top             =   495
  90.       Width           =   5685
  91.       Begin VB.Frame fraSample1 
  92.          BeginProperty Font 
  93.             Name            =   "宋体"
  94.             Size            =   10.5
  95.             Charset         =   134
  96.             Weight          =   400
  97.             Underline       =   0   'False
  98.             Italic          =   0   'False
  99.             Strikethrough   =   0   'False
  100.          EndProperty
  101.          Height          =   3180
  102.          Left            =   180
  103.          TabIndex        =   11
  104.          Top             =   105
  105.          Width           =   5325
  106.          Begin VB.TextBox txtOwn 
  107.             BeginProperty Font 
  108.                Name            =   "宋体"
  109.                Size            =   10.5
  110.                Charset         =   134
  111.                Weight          =   400
  112.                Underline       =   0   'False
  113.                Italic          =   0   'False
  114.                Strikethrough   =   0   'False
  115.             EndProperty
  116.             Height          =   315
  117.             Index           =   1
  118.             Left            =   1320
  119.             TabIndex        =   1
  120.             Top             =   968
  121.             Width           =   3720
  122.          End
  123.          Begin VB.TextBox txtOwn 
  124.             BeginProperty Font 
  125.                Name            =   "宋体"
  126.                Size            =   10.5
  127.                Charset         =   134
  128.                Weight          =   400
  129.                Underline       =   0   'False
  130.                Italic          =   0   'False
  131.                Strikethrough   =   0   'False
  132.             EndProperty
  133.             Height          =   315
  134.             Index           =   2
  135.             Left            =   1320
  136.             TabIndex        =   2
  137.             Top             =   1493
  138.             Width           =   3720
  139.          End
  140.          Begin VB.TextBox txtOwn 
  141.             BeginProperty Font 
  142.                Name            =   "宋体"
  143.                Size            =   10.5
  144.                Charset         =   134
  145.                Weight          =   400
  146.                Underline       =   0   'False
  147.                Italic          =   0   'False
  148.                Strikethrough   =   0   'False
  149.             EndProperty
  150.             Height          =   315
  151.             Index           =   3
  152.             Left            =   1320
  153.             TabIndex        =   3
  154.             Top             =   2018
  155.             Width           =   3720
  156.          End
  157.          Begin VB.TextBox txtOwn 
  158.             BeginProperty Font 
  159.                Name            =   "宋体"
  160.                Size            =   10.5
  161.                Charset         =   134
  162.                Weight          =   400
  163.                Underline       =   0   'False
  164.                Italic          =   0   'False
  165.                Strikethrough   =   0   'False
  166.             EndProperty
  167.             Height          =   315
  168.             Index           =   5
  169.             Left            =   3780
  170.             TabIndex        =   5
  171.             Top             =   2543
  172.             Width           =   1230
  173.          End
  174.          Begin VB.TextBox txtOwn 
  175.             BeginProperty Font 
  176.                Name            =   "宋体"
  177.                Size            =   10.5
  178.                Charset         =   134
  179.                Weight          =   400
  180.                Underline       =   0   'False
  181.                Italic          =   0   'False
  182.                Strikethrough   =   0   'False
  183.             EndProperty
  184.             Height          =   315
  185.             Index           =   4
  186.             Left            =   1320
  187.             TabIndex        =   4
  188.             Top             =   2543
  189.             Width           =   1230
  190.          End
  191.          Begin VB.TextBox txtOwn 
  192.             BeginProperty Font 
  193.                Name            =   "宋体"
  194.                Size            =   10.5
  195.                Charset         =   134
  196.                Weight          =   400
  197.                Underline       =   0   'False
  198.                Italic          =   0   'False
  199.                Strikethrough   =   0   'False
  200.             EndProperty
  201.             Height          =   315
  202.             Index           =   0
  203.             Left            =   1320
  204.             TabIndex        =   0
  205.             Top             =   413
  206.             Width           =   3720
  207.          End
  208.          Begin VB.Label Label1 
  209.             AutoSize        =   -1  'True
  210.             Caption         =   "法人代表:"
  211.             BeginProperty Font 
  212.                Name            =   "宋体"
  213.                Size            =   10.5
  214.                Charset         =   134
  215.                Weight          =   400
  216.                Underline       =   0   'False
  217.                Italic          =   0   'False
  218.                Strikethrough   =   0   'False
  219.             EndProperty
  220.             Height          =   210
  221.             Index           =   5
  222.             Left            =   2775
  223.             TabIndex        =   23
  224.             Top             =   2595
  225.             Width           =   945
  226.          End
  227.          Begin VB.Label Label1 
  228.             AutoSize        =   -1  'True
  229.             Caption         =   "邮政编码:"
  230.             BeginProperty Font 
  231.                Name            =   "宋体"
  232.                Size            =   10.5
  233.                Charset         =   134
  234.                Weight          =   400
  235.                Underline       =   0   'False
  236.                Italic          =   0   'False
  237.                Strikethrough   =   0   'False
  238.             EndProperty
  239.             Height          =   210
  240.             Index           =   4
  241.             Left            =   315
  242.             TabIndex        =   22
  243.             Top             =   2595
  244.             Width           =   945
  245.          End
  246.          Begin VB.Label Label1 
  247.             AutoSize        =   -1  'True
  248.             Caption         =   "联系传真:"
  249.             BeginProperty Font 
  250.                Name            =   "宋体"
  251.                Size            =   10.5
  252.                Charset         =   134
  253.                Weight          =   400
  254.                Underline       =   0   'False
  255.                Italic          =   0   'False
  256.                Strikethrough   =   0   'False
  257.             EndProperty
  258.             Height          =   210
  259.             Index           =   3
  260.             Left            =   315
  261.             TabIndex        =   21
  262.             Top             =   2070
  263.             Width           =   945
  264.          End
  265.          Begin VB.Label Label1 
  266.             AutoSize        =   -1  'True
  267.             Caption         =   "联系电话:"
  268.             BeginProperty Font 
  269.                Name            =   "宋体"
  270.                Size            =   10.5
  271.                Charset         =   134
  272.                Weight          =   400
  273.                Underline       =   0   'False
  274.                Italic          =   0   'False
  275.                Strikethrough   =   0   'False
  276.             EndProperty
  277.             Height          =   210
  278.             Index           =   2
  279.             Left            =   315
  280.             TabIndex        =   20
  281.             Top             =   1545
  282.             Width           =   945
  283.          End
  284.          Begin VB.Label Label1 
  285.             AutoSize        =   -1  'True
  286.             Caption         =   "公司地址:"
  287.             BeginProperty Font 
  288.                Name            =   "宋体"
  289.                Size            =   10.5
  290.                Charset         =   134
  291.                Weight          =   400
  292.                Underline       =   0   'False
  293.                Italic          =   0   'False
  294.                Strikethrough   =   0   'False
  295.             EndProperty
  296.             Height          =   210
  297.             Index           =   1
  298.             Left            =   315
  299.             TabIndex        =   19
  300.             Top             =   1020
  301.             Width           =   945
  302.          End
  303.          Begin VB.Label Label1 
  304.             AutoSize        =   -1  'True
  305.             Caption         =   "公司名称:"
  306.             BeginProperty Font 
  307.                Name            =   "宋体"
  308.                Size            =   10.5
  309.                Charset         =   134
  310.                Weight          =   400
  311.                Underline       =   0   'False
  312.                Italic          =   0   'False
  313.                Strikethrough   =   0   'False
  314.             EndProperty
  315.             Height          =   210
  316.             Index           =   0
  317.             Left            =   315
  318.             TabIndex        =   18
  319.             Top             =   465
  320.             Width           =   945
  321.          End
  322.       End
  323.    End
  324.    Begin VB.CommandButton cmdApply 
  325.       BeginProperty Font 
  326.          Name            =   "宋体"
  327.          Size            =   10.5
  328.          Charset         =   134
  329.          Weight          =   400
  330.          Underline       =   0   'False
  331.          Italic          =   0   'False
  332.          Strikethrough   =   0   'False
  333.       EndProperty
  334.       Height          =   465
  335.       Left            =   3442
  336.       Picture         =   "frmOption.frx":000C
  337.       Style           =   1  'Graphical
  338.       TabIndex        =   8
  339.       Top             =   4230
  340.       Width           =   1215
  341.    End
  342.    Begin VB.CommandButton cmdCancel 
  343.       Cancel          =   -1  'True
  344.       BeginProperty Font 
  345.          Name            =   "宋体"
  346.          Size            =   10.5
  347.          Charset         =   134
  348.          Weight          =   400
  349.          Underline       =   0   'False
  350.          Italic          =   0   'False
  351.          Strikethrough   =   0   'False
  352.       EndProperty
  353.       Height          =   465
  354.       Left            =   4770
  355.       Picture         =   "frmOption.frx":1BBD
  356.       Style           =   1  'Graphical
  357.       TabIndex        =   7
  358.       Top             =   4230
  359.       Width           =   1215
  360.    End
  361.    Begin VB.CommandButton cmdOK 
  362.       BeginProperty Font 
  363.          Name            =   "宋体"
  364.          Size            =   10.5
  365.          Charset         =   134
  366.          Weight          =   400
  367.          Underline       =   0   'False
  368.          Italic          =   0   'False
  369.          Strikethrough   =   0   'False
  370.       EndProperty
  371.       Height          =   465
  372.       Left            =   2115
  373.       Picture         =   "frmOption.frx":38FC
  374.       Style           =   1  'Graphical
  375.       TabIndex        =   6
  376.       Top             =   4230
  377.       Width           =   1215
  378.    End
  379.    Begin ComctlLib.TabStrip tbsOptions 
  380.       Height          =   3930
  381.       Left            =   120
  382.       TabIndex        =   9
  383.       Top             =   120
  384.       Width           =   5895
  385.       _ExtentX        =   10398
  386.       _ExtentY        =   6932
  387.       _Version        =   327682
  388.       BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7} 
  389.          NumTabs         =   1
  390.          BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  391.             Caption         =   "公司设置"
  392.             Key             =   "mMyCompany"
  393.             Object.Tag             =   ""
  394.             Object.ToolTipText     =   "为本公司设置选项"
  395.             ImageVarType    =   2
  396.          EndProperty
  397.       EndProperty
  398.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  399.          Name            =   "Tahoma"
  400.          Size            =   9
  401.          Charset         =   0
  402.          Weight          =   400
  403.          Underline       =   0   'False
  404.          Italic          =   0   'False
  405.          Strikethrough   =   0   'False
  406.       EndProperty
  407.    End
  408. End
  409. Attribute VB_Name = "frmOption"
  410. Attribute VB_GlobalNameSpace = False
  411. Attribute VB_Creatable = False
  412. Attribute VB_PredeclaredId = True
  413. Attribute VB_Exposed = False
  414. Option Explicit
  415. Private Sub cmdApply_Click()
  416.     gOwnName = Trim(txtOwn(0))
  417.     gOwnAddress = Trim(txtOwn(1))
  418.     gOwnPhone = Trim(txtOwn(2))
  419.     gOwnFax = Trim(txtOwn(3))
  420.     gOwnPost = Trim(txtOwn(4))
  421.     gOwnOwner = Trim(txtOwn(5))
  422.     SaveRegister
  423. End Sub
  424. Private Sub cmdCancel_Click()
  425.     Unload Me
  426. End Sub
  427. Private Sub cmdOK_Click()
  428.     cmdApply_Click
  429.     Unload Me
  430. End Sub
  431. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  432.     Dim i As Integer
  433.     '处理 ctrl+tab 键,移动到下一个选项卡
  434.     If Shift = vbCtrlMask And KeyCode = vbKeyTab Then
  435.         i = tbsOptions.SelectedItem.Index
  436.         If i = tbsOptions.Tabs.Count Then
  437.             '最后一个选项卡,返回到选项卡 1
  438.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
  439.         Else
  440.             ' 选项卡序数加 1
  441.             Set tbsOptions.SelectedItem = tbsOptions.Tabs(i + 1)
  442.         End If
  443.     End If
  444.     
  445.     Dim AltDown As Boolean
  446.     AltDown = (Shift And vbAltMask) > 0
  447.     If AltDown Then
  448.         Select Case KeyCode
  449.             Case vbKeyA
  450.                 cmdApply_Click
  451.             Case vbKeyK
  452.                 cmdOK_Click
  453.             Case vbKeyC
  454.                 cmdCancel_Click
  455.         End Select
  456.     End If
  457.     
  458.     If KeyCode = 27 Then
  459.         cmdCancel_Click
  460.     End If
  461. End Sub
  462. Private Sub Form_Load()
  463.     '窗体居中
  464.     Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
  465.     txtOwn(0) = gOwnName
  466.     txtOwn(1) = gOwnAddress
  467.     txtOwn(2) = gOwnPhone
  468.     txtOwn(3) = gOwnFax
  469.     txtOwn(4) = gOwnPost
  470.     txtOwn(5) = gOwnOwner
  471. End Sub
  472. Private Sub tbsOptions_Click()
  473.     Dim i As Integer
  474.     '显示并激活选中的选项卡控件
  475.     '隐藏并禁止所有其它控件
  476.     For i = 0 To tbsOptions.Tabs.Count - 1
  477.         If i = tbsOptions.SelectedItem.Index - 1 Then
  478.             picOptions(i).Left = 210
  479.             picOptions(i).Enabled = True
  480.         Else
  481.             picOptions(i).Left = -20000
  482.             picOptions(i).Enabled = False
  483.         End If
  484.     Next
  485.     
  486. End Sub
  487. Private Sub txtOwn_GotFocus(Index As Integer)
  488.     GotFocus txtOwn(Index)
  489. End Sub
  490. Private Sub txtOwn_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  491.     If KeyCode = vbKeyReturn Then
  492.         SendKeyTab KeyCode
  493.     End If
  494. End Sub