📄 frmselectgroup.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmSelectGroup
BorderStyle = 3 'Fixed Dialog
Caption = "浏览组"
ClientHeight = 3795
ClientLeft = 45
ClientTop = 330
ClientWidth = 3510
Icon = "frmSelectGroup.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3795
ScaleWidth = 3510
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 285
Left = 2430
TabIndex = 2
Top = 3375
Width = 915
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 285
Left = 1350
TabIndex = 1
Top = 3375
Width = 915
End
Begin MSComctlLib.TreeView TVSelectGroup
Height = 2760
Left = 105
TabIndex = 0
Top = 405
Width = 3300
_ExtentX = 5821
_ExtentY = 4868
_Version = 393217
Style = 7
Appearance = 1
End
Begin VB.Label Label1
Caption = "请选择一个组:"
Height = 195
Left = 135
TabIndex = 3
Top = 135
Width = 1275
End
End
Attribute VB_Name = "frmSelectGroup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*****************************************************
'* *
'* 选择任务或计划的联系人所属组 *
'* *
'*****************************************************
Private Sub cmdCancel_Click()
'放弃所选择的组
frmSelectGroup.Tag = ""
frmSelectGroup.Visible = False
End Sub
Private Sub cmdOK_Click()
If TVSelectGroup.SelectedItem.Key = "linkman" Then
'选定了根级的"联系人"组
frmSelectGroup.Tag = "0"
Else
'选定了其它的组
frmSelectGroup.Tag = Left(TVSelectGroup.SelectedItem.Key, Len(TVSelectGroup.SelectedItem.Key) - 1)
End If
frmSelectGroup.Visible = False
End Sub
Private Sub Form_Load()
Set TVSelectGroup.ImageList = frmMain.ImageList16
TVSelectGroup.Nodes.Add , , "linkman", "联系人", 2
'将所有组加入TreeView
Call RansackGroup("linkman")
TVSelectGroup.Nodes("linkman").Expanded = True
End Sub
'列出所有组
Private Sub RansackGroup(parent As String)
Set tmpnode = frmMain.TVlinkman.Nodes(parent).Child
While TypeName(tmpnode) <> "Nothing"
If Right(tmpnode.Key, 1) = "G" Then
'若为组,则将其加入TreeView,并且递归搜索其下一级
TVSelectGroup.Nodes.Add parent, tvwChild, tmpnode.Key, tmpnode.Text, 3
RansackGroup (tmpnode.Key)
End If
Set tmpnode = tmpnode.Next
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -