?? 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 + -