📄 frmeditcenter.frm
字号:
VERSION 5.00
Begin VB.Form frmEditCenter
Caption = "中心信息编辑窗口"
ClientHeight = 5400
ClientLeft = 60
ClientTop = 345
ClientWidth = 7875
Icon = "frmEditCenter.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5400
ScaleWidth = 7875
Begin VB.TextBox txtCode
Height = 300
Left = 1350
TabIndex = 0
Top = 320
Width = 855
End
Begin VB.CommandButton cmdSave
Caption = "确 定 "
Height = 375
Left = 5178
Style = 1 'Graphical
TabIndex = 22
Top = 4680
Width = 975
End
Begin VB.ComboBox cmbStatus
Height = 300
Left = 6390
Style = 2 'Dropdown List
TabIndex = 13
Top = 3640
Width = 1215
End
Begin VB.CommandButton cmdLast
Caption = ">>"
Height = 255
Left = 6210
Style = 1 'Graphical
TabIndex = 17
Top = 4200
Width = 1095
End
Begin VB.CommandButton cmdNext
Caption = ">"
Height = 255
Left = 4330
Style = 1 'Graphical
TabIndex = 16
Top = 4200
Width = 1095
End
Begin VB.CommandButton cmdPrevious
Caption = "<"
Height = 255
Left = 2450
Style = 1 'Graphical
TabIndex = 15
Top = 4200
Width = 1095
End
Begin VB.CommandButton cmdFirst
Caption = "<<"
Height = 255
Left = 570
Style = 1 'Graphical
TabIndex = 14
Top = 4200
Width = 1095
End
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 375
Left = 6330
Style = 1 'Graphical
TabIndex = 23
Top = 4680
Width = 975
End
Begin VB.CommandButton cmdModify
Caption = "修改记录"
Height = 375
Left = 4026
Style = 1 'Graphical
TabIndex = 21
Top = 4680
Width = 975
End
Begin VB.CommandButton cmdDel
Caption = "删除记录"
Height = 375
Left = 2874
Style = 1 'Graphical
TabIndex = 20
Top = 4680
Width = 975
End
Begin VB.CommandButton cmdCancel
Caption = "放 弃"
Height = 375
Left = 1722
Style = 1 'Graphical
TabIndex = 19
Top = 4680
Width = 975
End
Begin VB.CommandButton cmdAdd
Caption = "添加记录"
Height = 375
Left = 570
Style = 1 'Graphical
TabIndex = 18
Top = 4680
Width = 975
End
Begin VB.ComboBox cmbRegion
Height = 300
Left = 6390
Style = 2 'Dropdown List
TabIndex = 11
Top = 2720
Width = 1215
End
Begin VB.ComboBox cmbProvince
Height = 300
Left = 6390
Style = 2 'Dropdown List
TabIndex = 10
Top = 1760
Width = 1215
End
Begin VB.ComboBox cmbCType
Height = 300
Left = 6390
Style = 2 'Dropdown List
TabIndex = 8
Top = 320
Width = 1215
End
Begin VB.TextBox txtCity
Height = 300
Left = 6390
TabIndex = 9
Top = 800
Width = 1215
End
Begin VB.TextBox txtPostCode
Height = 300
Left = 6390
TabIndex = 12
Top = 3160
Width = 1215
End
Begin VB.TextBox txtName
Height = 300
Left = 1320
TabIndex = 1
Top = 800
Width = 3015
End
Begin VB.TextBox txtWeb
Height = 300
Left = 1350
TabIndex = 7
Top = 3640
Width = 3015
End
Begin VB.TextBox txtEMail
Height = 300
Left = 1350
TabIndex = 6
Top = 3160
Width = 1815
End
Begin VB.TextBox txtFax
Height = 300
Left = 1350
TabIndex = 5
Top = 2680
Width = 1815
End
Begin VB.TextBox txtTel
Height = 300
Left = 1350
TabIndex = 4
Top = 2200
Width = 1815
End
Begin VB.TextBox txtContactor
Height = 300
Left = 1350
TabIndex = 3
Top = 1720
Width = 1815
End
Begin VB.TextBox txtAddress
Height = 300
Left = 1350
TabIndex = 2
Top = 1280
Width = 6255
End
Begin VB.Label lblCode
Caption = "中心代码"
Height = 300
Left = 270
TabIndex = 39
Top = 360
Width = 975
End
Begin VB.Label lblStatus
Caption = "中心状态"
Height = 300
Left = 5190
TabIndex = 38
Top = 3720
Width = 975
End
Begin VB.Label lblExampleFax
AutoSize = -1 'True
Caption = "格式:同电话号码"
Height = 300
Left = 3240
TabIndex = 37
Top = 2760
Width = 1590
End
Begin VB.Label lblExampleTel
AutoSize = -1 'True
Caption = " 格式:010-62767002/3/4,62754649"
Height = 315
Left = 3270
TabIndex = 36
Top = 2280
Width = 2580
End
Begin VB.Label lblCType
Caption = "中心类型"
Height = 300
Left = 5190
TabIndex = 35
Top = 360
Width = 975
End
Begin VB.Label lblPostCode
Caption = "邮政编码"
Height = 300
Left = 5190
TabIndex = 34
Top = 3240
Width = 975
End
Begin VB.Label lblRegion
Caption = "所在区域"
Height = 300
Left = 5190
TabIndex = 33
Top = 2760
Width = 975
End
Begin VB.Label lblProvince
Caption = "所在省、区、直辖市"
Height = 255
Left = 4230
TabIndex = 32
Top = 1800
Width = 1935
End
Begin VB.Label lblCity
Caption = "所在城市"
Height = 300
Left = 5190
TabIndex = 31
Top = 840
Width = 975
End
Begin VB.Label lblWeb
Caption = "网址"
Height = 300
Left = 270
TabIndex = 30
Top = 3675
Width = 975
End
Begin VB.Label lblEMail
Caption = "E-Mail"
Height = 300
Left = 270
TabIndex = 29
Top = 3195
Width = 975
End
Begin VB.Label lblFax
Caption = "传真号码"
Height = 300
Left = 270
TabIndex = 28
Top = 2715
Width = 975
End
Begin VB.Label lblTel
Caption = "电话号码"
Height = 300
Left = 270
TabIndex = 27
Top = 2235
Width = 975
End
Begin VB.Label lblContactor
Caption = "联系人"
Height = 300
Left = 270
TabIndex = 26
Top = 1755
Width = 975
End
Begin VB.Label lblAddress
Caption = "中心地址"
Height = 300
Left = 270
TabIndex = 25
Top = 1320
Width = 975
End
Begin VB.Label lblName
Caption = "中心名称"
Height = 300
Left = 270
TabIndex = 24
Top = 840
Width = 975
End
End
Attribute VB_Name = "frmEditCenter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdAdd_Click()
cmdFlag = 1
Dim ctlcontrol As Control
'禁用除 添加记录 放弃添加 确定 退出 以外的所有按钮控件
For Each ctlcontrol In Controls
If TypeOf ctlcontrol Is CommandButton Then
If ctlcontrol.Name = "cmdAdd" Or ctlcontrol.Name = "cmdCancel" Or ctlcontrol.Name = "cmdSave" Or ctlcontrol.Name = "cmdExit" Then
ctlcontrol.Enabled = True
Else
ctlcontrol.Enabled = False
End If
End If
Next
'清除所有控件的文本显示,DisplayRefresh子程 见本窗体
DisplayRefresh
cmbStatus.Text = "1"
cmbStatus.Enabled = False
cmdCancel.SetFocus
End Sub
Private Sub cmdCancel_Click()
cmdFlag = 0
'清除所有控件的文本显示,DisplayRefresh子程 见本窗体
DisplayRefresh
'消除控件的禁用,ControlEnabled子程 见本窗体
ControlEnabled
End Sub
Private Sub cmdDel_Click()
cmdFlag = 2
'禁用 添加记录 修改记录 按钮控件
Dim ctlcontrol As Control
For Each ctlcontrol In Controls
If TypeOf ctlcontrol Is CommandButton Then
If ctlcontrol.Name = "cmdAdd" Or ctlcontrol.Name = "cmdModify" Then
ctlcontrol.Enabled = False
End If
End If
Next
'禁用控件文本框和组合框,ControlDisabled子程 见本窗体
ControlDisabled
cmdCancel.SetFocus
End Sub
Private Sub cmdExit_Click()
'关闭记录集,RsClose函数 见模块MdlConnection
RsClose rs
'关闭窗体
Unload Me
End Sub
Private Sub cmdFirst_Click()
rs.MoveFirst
'显示当前记录内容,Display子程 见本窗体
Display
End Sub
Private Sub cmdLast_Click()
rs.MoveLast
'显示当前记录内容,Display子程 见本窗体
Display
End Sub
Private Sub cmdModify_Click()
cmdFlag = 3
'禁用 添加记录 删除记录 按钮控件
Dim ctlcontrol As Control
For Each ctlcontrol In Controls
If TypeOf ctlcontrol Is CommandButton Then
If ctlcontrol.Name = "cmdAdd" Or ctlcontrol.Name = "cmdDel" Then
ctlcontrol.Enabled = False
End If
End If
Next
txtCode.Enabled = False
cmdCancel.SetFocus
End Sub
Private Sub cmdNext_Click()
With rs
.MoveNext
If .EOF Then .MoveLast
End With
'显示当前记录内容,Display子程 见本窗体
Display
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -