📄 frmclientgroupedit.frm
字号:
VERSION 5.00
Begin VB.Form FrmClientGroupEdit
BorderStyle = 3 'Fixed Dialog
Caption = "编辑客户组信息"
ClientHeight = 4005
ClientLeft = 45
ClientTop = 435
ClientWidth = 4905
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4005
ScaleWidth = 4905
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Height = 3255
Left = 240
TabIndex = 0
Top = 120
Width = 4335
Begin VB.TextBox txtDescribe
Height = 1695
Left = 1440
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 1320
Width = 2655
End
Begin VB.TextBox txtDep
Height = 270
Left = 1440
MaxLength = 20
TabIndex = 1
Top = 795
Width = 2655
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "功能描述"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 6
Top = 1320
Width = 1020
End
Begin VB.Label lblUpper
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "上级客户组"
Height = 195
Left = 1800
TabIndex = 5
Top = 360
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "上级客户组"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 4
Top = 360
Width = 1275
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "客户组名称"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 3
Top = 840
Width = 1275
End
End
Begin VB.Label LblOK
BackStyle = 0 'Transparent
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
MouseIcon = "FrmClientGroupEdit.frx":0000
MousePointer = 99 'Custom
TabIndex = 8
Top = 3480
Width = 735
End
Begin VB.Image Image3
Height = 300
Left = 720
Picture = "FrmClientGroupEdit.frx":030A
Top = 3480
Width = 300
End
Begin VB.Label LblCancel
BackStyle = 0 'Transparent
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
MouseIcon = "FrmClientGroupEdit.frx":0726
MousePointer = 99 'Custom
TabIndex = 7
Top = 3480
Width = 855
End
Begin VB.Image Image4
Height = 300
Left = 2760
Picture = "FrmClientGroupEdit.frx":0A30
Top = 3480
Width = 300
End
End
Attribute VB_Name = "FrmClientGroupEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Private Sub LblCancel_Click()
Unload Me
End Sub
Private Sub LblOK_Click()
If Trim(txtDep) = "" Then
MsgBox "请输入部门名称"
Exit Sub
End If
'将新输入的数据保存到类变量中
With MyDep
.Dep_name = MakeStr(txtDep)
.Describe = MakeStr(txtDescribe)
If Modify = False Then '插入
If .In_DB(.Dep_name, .UpperId) = True Then
MsgBox Trim(txtDep) + " 已经存在"
Exit Sub
End If
'CurDep中保存在部门管理窗体中选中的部门信息
'当插入新记录时,新记录将做为当前部门的下级部门
.UpperId = CurDep.Dep_Id
Bh = .Insert
'生成TreeView中一个结点的关键字
Tmp_Key = "a" + Trim(Str(Bh))
'设置结点的图像
FrmClientGroup.TreeView1.SelectedItem.Image = 1
FrmClientGroup.TreeView1.SelectedItem.ExpandedImage = 2
FrmClientGroup.TreeView1.SelectedItem.SelectedImage = 3
'在树中添加一个结点
Set TmpNode = FrmClientGroup.TreeView1.Nodes.Add(FrmClientGroup.TreeView1.SelectedItem.Key, _
tvwChild, Tmp_Key, .Dep_name, 4, 5)
TmpNode.Selected = True
Else '修改
If CurDep.Dep_name <> Trim(txtDep) Then
If .In_DB(Trim(txtDep), .UpperId) = True Then
MsgBox Trim(txtDep) + " 已经存在"
Exit Sub
End If
End If
'当修改记录时,不能改变上下级之间的关系
.UpperId = CurDep.UpperId
.Update (CurDep.Dep_Id)
If CurDep.Dep_name <> Trim(txtDep) Then
FrmClientGroup.TreeView1.SelectedItem.Text = Trim(txtDep)
End If
'设置CurDep变量
CurDep.Dep_name = Trim(txtDep)
End If
End With
'关闭窗口
Unload Me
End Sub
Private Sub txtDep_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -