📄 frmclasssel.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmClassSel
BorderStyle = 1 'Fixed Single
ClientHeight = 3870
ClientLeft = 15
ClientTop = 15
ClientWidth = 5550
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3870
ScaleWidth = 5550
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmd_OK
BackColor = &H80000004&
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 1158
MouseIcon = "FrmClassSel.frx":0000
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 1
Top = 3240
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
BackColor = &H80000004&
Caption = "取 消"
Height = 400
Left = 3093
MouseIcon = "FrmClassSel.frx":030A
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 2
Top = 3240
Width = 1300
End
Begin MSComctlLib.ImageList ImageList3
Left = 0
Top = 3120
_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 = "FrmClassSel.frx":0614
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClassSel.frx":2FA6
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClassSel.frx":5938
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClassSel.frx":82CA
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmClassSel.frx":AC5C
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView TreeView1
Height = 3015
Left = 240
TabIndex = 0
Top = 120
Width = 5055
_ExtentX = 8916
_ExtentY = 5318
_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 = "FrmClassSel.frx":D5EE
End
End
Attribute VB_Name = "FrmClassSel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
If MyClass.Class_Id <= 0 Then
MsgBox "请选择院系班级"
Exit Sub
End If
'将选择院系班级的数据保存在CurClass变量中
CurClass.Class_Id = MyClass.Class_Id
CurClass.GetInfo (CurClass.Class_Id)
Unload Me
End Sub
Private Sub Form_Load()
Dim TmpNode As Node
FocusClassName = "学校领导"
Focuskey = ""
'设置根结点
Set TmpNode = TreeView1.Nodes.Add(, , "a0", "院系班级信息", 1, 3)
TmpNode.Selected = True
TmpNode.ExpandedImage = 2
'调用函数将所有院系班级添加到TreeView1中
Call Add_ClassToTree(TreeView1, "a0")
TreeView1_Click
End Sub
Private Sub TreeView1_Click()
Dim Focuskey As String
'根据关键字获取院系班级信息
Focuskey = TreeView1.SelectedItem.Key
MyClass.Class_Name = TreeView1.SelectedItem.Text
MyClass.Class_Id = Val(Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1))
If Focuskey = "a0" Then '根结点
Exit Sub
End If
'如果包含子结点,则设置图像格式
If MyClass.HaveSon(MyClass.Class_Id) = False Then
TreeView1.SelectedItem.ExpandedImage = 4
TreeView1.SelectedItem.Image = 4
TreeView1.SelectedItem.SelectedImage = 5
End If
'读取MyClass中的所有院系班级信息
MyClass.GetInfo (MyClass.Class_Id)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -