hsfl.net
当前位置:首页 >> vB trEEviEw >>

vB trEEviEw

TreeView1.Nodes.Add , , "r", "学籍管理信息系统", 1 TreeView1.Nodes.Add "r", tvwChild, "r1", "学生基本信息", 2 TreeView1.Nodes.Add "r1", tvwChild, "r11", "个人信息", 3 TreeView1.Nodes.Add "r1", tvwChild, "r12", "家庭信息", 3 Tre...

VB添加TreeView控件步骤: 菜单工程-部件-在对话框中勾选Microsoft Windows Common Controls 6.0。工具箱内就添加了一批ActiveX 控件。 双击下图红色框住的TreeView控件,窗体上就添加了TreeView控件。

Private Sub Form_Load() TreeView1.LineStyle = tvwRootLines TreeView1.Indentation = 200 TreeView1.Nodes.Add , , "Text", "Text" TreeView1.Nodes.Add "Text", tvwChild, "TestSub1", "TestSub1" TreeView1.Nodes.Add "Text", tvwChild, "T...

'VB利用ADODB连接ACCESS数据库,执行查询、删除操作'引用Microsoft ActiveX Data Objects 2.8 LibraryDim select_id As StringDim ConnStr As StringPrivate Sub Command1_Click() '刷新GetValueEnd SubPrivate Sub Form_Load()ConnStr = "Provi...

代码如下所示: Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) If Node.Text = "计算机系" Then MsgBox "1" If Node.Text = "经管系" Then MsgBox "2"End Sub运行截图:

Private Sub Command1_Click() num = 0 For i = 1 To TreeView1.Nodes.Count If TreeView1.Nodes(i).Children > 0 Then num = num + 1 End If Next MsgBox num End Sub

再加一些菜单 Private Sub TreeView1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then select case treeview1.nodes.key case ?? PopupMenu edit1 case ??? PopupMenu edit2 ... end select End Sub

添加 ImageList 控件,在 ImageList 控件中添加ioc图标,在Treeview 中调用。

使用触发事件:节点条目的单击click事件,将触发NodeClick事件

'新建一个窗体,上面放一个TreeView和一个ListView,一个ListImage 'ListImage控件要添加8张以上一样大小的icon文件 'TreeView1和ListView的图像列表都设置成ListImage1 Private Sub Form_Load() TreeView1.Style = tvwTreelinesPlusMinusPicture...

网站首页 | 网站地图
All rights reserved Powered by www.hsfl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com