?? frmclientgroup.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form FrmClientGroup
BorderStyle = 3 'Fixed Dialog
Caption = "客戶組管理"
ClientHeight = 5160
ClientLeft = 45
ClientTop = 435
ClientWidth = 6615
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5160
ScaleWidth = 6615
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin MSComctlLib.ImageList ImageList1
Left = 480
Top = 3600
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483628
ImageWidth = 16
ImageHeight = 16
MaskColor = 16777215
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClientGroup.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClientGroup.frx":2992
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClientGroup.frx":5324
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClientGroup.frx":7CB6
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClientGroup.frx":A648
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 3975
Left = 360
TabIndex = 0
Top = 360
Width = 5775
_ExtentX = 10186
_ExtentY = 7011
_Version = 393217
LabelEdit = 1
Sorted = -1 'True
Style = 7
HotTracking = -1 'True
SingleSel = -1 'True
ImageList = "ImageList1"
BorderStyle = 1
Appearance = 1
MousePointer = 99
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "FrmClientGroup.frx":CFDA
End
Begin VB.Label LblAdd
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 = 1080
MouseIcon = "FrmClientGroup.frx":D2F4
MousePointer = 99 'Custom
TabIndex = 4
Top = 4560
Width = 615
End
Begin VB.Image Image5
Height = 300
Left = 480
Picture = "FrmClientGroup.frx":D5FE
Top = 4560
Width = 300
End
Begin VB.Label LblModify
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 = 2640
MouseIcon = "FrmClientGroup.frx":DA1A
MousePointer = 99 'Custom
TabIndex = 3
Top = 4560
Width = 615
End
Begin VB.Image Image2
Height = 300
Left = 2040
Picture = "FrmClientGroup.frx":DD24
Top = 4560
Width = 300
End
Begin VB.Label LblDelete
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 = 4080
MouseIcon = "FrmClientGroup.frx":E140
MousePointer = 99 'Custom
TabIndex = 2
Top = 4560
Width = 615
End
Begin VB.Image Image3
Height = 300
Left = 3480
Picture = "FrmClientGroup.frx":E44A
Top = 4560
Width = 300
End
Begin VB.Label LblBack
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 = 5520
MouseIcon = "FrmClientGroup.frx":E866
MousePointer = 99 'Custom
TabIndex = 1
Top = 4560
Width = 615
End
Begin VB.Image Image4
Height = 300
Left = 4920
Picture = "FrmClientGroup.frx":EB70
Top = 4560
Width = 300
End
End
Attribute VB_Name = "FrmClientGroup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim TmpNode As Node
'設置根結點
Set TmpNode = TreeView1.Nodes.Add(, , "a0", "客戶組信息", 1, 3)
TmpNode.Selected = True
TmpNode.ExpandedImage = 2
'調用函數將所有部門添加到TreeView1中
Call Add_DepToTree(TreeView1, "a0")
TreeView1_Click
End Sub
Private Sub LblAdd_Click()
'初始化FrmClientGroupEdit信息
FrmClientGroupEdit.lblUpper = CurDep.Dep_name
FrmClientGroupEdit.txtDep = ""
FrmClientGroupEdit.txtDescribe = ""
FrmClientGroupEdit.Modify = False
'打開編輯部門信息的窗體
FrmClientGroupEdit.Show 1
TreeView1_Click
End Sub
Private Sub Lblback_Click()
Unload Me
FrmMain.TreeView1.Nodes.Remove (1)
FrmMain.TreeView1.Refresh
End Sub
Private Sub LblDelete_Click()
If TreeView1.SelectedItem.Key = "a0" Then
MsgBox "此項不能刪除"
Exit Sub
End If
'如果當前部門包含下一級部門,則不能刪除
If CurDep.HaveSon(CurDep.Dep_Id) = True Then
MsgBox CurDep.Dep_name + " 包含下級部門,不能刪除"
Exit Sub
End If
' 如果部門中包含員工,則不能刪除
If MyDep.HaveEmp(CurDep.Dep_Id) = True Then
MsgBox CurDep.Dep_name + " 包含客戶,不能刪除"
Exit Sub
End If
'確定刪除
If MsgBox("是否確定要刪除 " + Trim(TreeView1.SelectedItem.Text), vbYesNo, "請確認") = vbNo Then
Exit Sub
End If
Call CurDep.Delete(CurDep.Dep_Id)
TreeView1.Nodes.Remove TreeView1.SelectedItem.Index
TreeView1_Click
End Sub
Private Sub LblModify_Click()
'不能修改根結點
If TreeView1.SelectedItem.Key = "a0" Then
MsgBox "此項不能修改"
Exit Sub
End If
'將當前部門的信息賦值到編輯部門信息的窗口
FrmClientGroupEdit.lblUpper = MyDep.GetName(CurDep.UpperId)
FrmClientGroupEdit.txtDep = CurDep.Dep_name
FrmClientGroupEdit.txtDescribe = CurDep.Describe
FrmClientGroupEdit.Modify = True
FrmClientGroupEdit.Show 1
TreeView1_Click
End Sub
Private Sub TreeView1_Click()
Dim Focuskey As String
'根據關鍵字獲取部門信息
Focuskey = TreeView1.SelectedItem.Key
CurDep.Dep_name = TreeView1.SelectedItem.Text
CurDep.Dep_Id = Val(Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1))
If Focuskey = "a0" Then '根結點
Exit Sub
End If
'如果包含子結點,則設置圖像格式
If CurDep.HaveSon(CurDep.Dep_Id) = False Then
TreeView1.SelectedItem.ExpandedImage = 4
TreeView1.SelectedItem.Image = 4
TreeView1.SelectedItem.SelectedImage = 5
End If
'讀取CurDep中的所有部門信息
CurDep.GetInfo (CurDep.Dep_Id)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -