【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“FrmAreaMan.frm”一文,供大家参考学习!
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form FrmAreaMan
BorderStyle = 1 'Fixed Single
Caption = "地域管理"
ClientHeight = 4725
ClientLeft = 45
ClientTop = 330
ClientWidth = 6135
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4725
ScaleWidth = 6135
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Add
BackColor = &H80000004&
Caption = "添 加"
Default = -1 'True
Height = 400
Left = 240
MouseIcon = "FrmAreaMan.frx":0000
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 1
Top = 4080
Width = 1300
End
Begin VB.CommandButton Cmd_Modi
BackColor = &H80000004&
Caption = "修 改"
Height = 400
Left = 1680
MouseIcon = "FrmAreaMan.frx":030A
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 2
Top = 4080
Width = 1300
End
Begin VB.CommandButton Cmd_Del
BackColor = &H80000004&
Caption = "删 除"
Height = 400
Left = 3120
MouseIcon = "FrmAreaMan.frx":0614
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 4080
Width = 1300
End
Begin
VB.CommandButton Cmd_Back
BackColor = &H80000004&
Cancel = -1 'True
Caption = "返 回"
Height = 400
Left = 4560
MouseIcon = "FrmAreaMan.frx":091E
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 4080
Width = 1300
End
Begin MSComctlLib.ImageList ImageList3
Left = 0
Top = 720
_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 = "FrmAreaMan.frx":0C28
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmAreaMan.frx":35BA
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmAreaMan.frx":5F4C
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmAreaMan.frx":88DE
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmAreaMan.frx":B270
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 3735
Left = 240
TabIndex = 0
Top = 120
Width = 5655
_ExtentX = 9975
_ExtentY = 6588
_Version = 393217
HideSelection = 0 'False
LabelEdit = 1
Sorted = -1 'True
Style = 7
HotTracking = -1 'True
SingleSel = -1 'True
ImageList = "ImageList3"
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 = "FrmAreaMan.frx":DC02
End
End
Attribute VB_Name = "FrmAreaMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Add_Click()
If CurArea.AreaType >= 4 Then
MsgBox "此地域已不能再细分"
Exit Sub
End If
'打开编辑窗体
FrmAreaEdit.lblUpper = CurArea.AreaName
FrmAreaEdit.txtArea = ""
FrmAreaEdit.Modify = False
FrmAreaEdit.Show 1
TreeView1_Click
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub Cmd_Del_Click()
Dim TmpOrg As String
If CurArea.AreaType = 0 Then
MsgBox "此项不能删除"
Exit Sub
End If
If CurArea.HaveSon(CurArea.AreaId) = True Then
MsgBox CurArea.AreaName + " 包含下级地域,不能删除"
Exit Sub
End If
TmpOrg = MyCust.Area_In_Customer(TmpAreaId)
If TmpOrg <> "" Then
MsgBox "地域中包含客户信息- " + TmpOrg + ",不允许删除"
Exit Sub
End If
'确认删除
If MsgBox("是否确定要删除 " + Trim(TreeView1.SelectedItem.Text), vbYesNo, "请确认") = vbNo Then
Exit Sub
End If
CurArea.Delete (CurArea.AreaId)
TreeView1.Nodes.Remove TreeView1.SelectedItem.Index
TreeView1_Click
End Sub
Private Sub Cmd_Modi_Click()
If TreeView1.SelectedItem.Key = "a0" Then
MsgBox "此项不能修改"
Exit Sub
End If
FrmAreaEdit.lblUpper = MyArea.GetName(CurArea.UpperId)
FrmAreaEdit.txtArea = CurArea.AreaName
FrmAreaEdit.Modify = True
FrmAreaEdit.Show 1
TreeView1_Click
End Sub
Private Sub Form_Load()
FocusAreaName = "中国"
'添加根结点
Set TmpNode = TreeView1.Nodes.Add(, , "a0", "全球地域", 1, 3)
TmpNode.Selected = True
TmpNode.ExpandedImage = 2
Call Add_AreaToTree(TreeView1)
TreeView1_Click
End Sub
Private Sub TreeView1_Click()
Dim TmpType As Integer
'根据关键字获取地域信息
FocusKey = TreeView1.SelectedItem.Key
CurArea.AreaName = TreeV