http://www.tutorialspoint.com/vb.net/vb.net_treeview.htm

vbscript教程  时间:2021-02-27  阅读:()
Copyrighttutorialspoint.
comVB.
NET-TREEVIEWCONTROLVB.
NET-TREEVIEWCONTROLTheTreeViewcontrolisusedtodisplayhierarchicalrepresentationsofitemssimilartothewaysthefilesandfoldersaredisplayedintheleftpaneoftheWindowsExplorer.
Eachnodemaycontainoneormorechildnodes.
Let'sclickonaTreeViewcontrolfromtheToolboxandplaceitontheform.
PropertiesoftheTreeViewControlThefollowingaresomeofthecommonlyusedpropertiesoftheTreeViewcontrol:S.
NPropertyDescription1BackColorGetsorsetsthebackgroundcolorforthecontrol.
2BackgroundImageGetsorsetthebackgroundimagefortheTreeViewcontrol.
3BackgroundImageLayoutGetsorsetsthelayoutofthebackgroundimagefortheTreeViewcontrol.
4BorderStyleGetsorsetstheborderstyleofthetreeviewcontrol.
5CheckBoxesGetsorsetsavalueindicatingwhethercheckboxesaredisplayednexttothetreenodesinthetreeviewcontrol.
6DataBindingsGetsthedatabindingsforthecontrol.
7FontGetsorsetsthefontofthetextdisplayedbythecontrol.
8FontHeightGetsorsetstheheightofthefontofthecontrol.
9ForeColorThecurrentforegroundcolorforthiscontrol,whichisthecolorthecontrolusestodrawitstext.
10ItemHeightGetsorsetstheheightofeachtreenodeinthetreeviewcontrol.
11NodesGetsthecollectionoftreenodesthatareassignedtothetreeviewcontrol.
12PathSeparatorGetsorsetsthedelimiterstringthatthetreenodepathuses.
13RightToLeftLayoutGetsorsetsavaluethatindicateswhethertheTreeViewshouldbelaidoutfromright-to-left.
14ScrollableGetsorsetsavalueindicatingwhetherthetreeviewcontroldisplaysscrollbarswhentheyareneeded.
15SelectedImageIndexGetsorsetstheimagelistindexvalueoftheimagethatisdisplayedwhenatreenodeisselected.
16SelectedImageKeyGetsorsetsthekeyofthedefaultimageshownwhenaTreeNodeisinaselectedstate.
17SelectedNodeGetsorsetsthetreenodethatiscurrentlyselectedinthetreeviewcontrol.
18ShowLinesGetsorsetsavalueindicatingwhetherlinesaredrawnbetweentreenodesinthetreeviewcontrol.
19ShowNodeToolTipsGetsorsetsavalueindicatingToolTipsareshownwhenthemousepointerhoversoveraTreeNode.
20ShowPlusMinusGetsorsetsavalueindicatingwhetherplus-sign+andminus-signbuttonsaredisplayednexttotreenodesthatcontainchildtreenodes.
21ShowRootLinesGetsorsetsavalueindicatingwhetherlinesaredrawnbetweenthetreenodesthatareattherootofthetreeview.
22SortedGetsorsetsavalueindicatingwhetherthetreenodesinthetreeviewaresorted.
23StateImageListGetsorsetstheimagelistthatisusedtoindicatethestateoftheTreeViewanditsnodes.
24TextGetsorsetsthetextoftheTreeView.
25TopNodeGetsorsetsthefirstfully-visibletreenodeinthetreeviewcontrol.
26TreeViewNodeSorterGetsorsetstheimplementationofIComparertoperformacustomsortoftheTreeViewnodes.
27VisibleCountGetsthenumberoftreenodesthatcanbefullyvisibleinthetreeviewcontrol.
MethodsoftheTreeViewControlThefollowingaresomeofthecommonlyusedmethodsoftheTreeViewcontrol:S.
NMethodName&Description1CollapseAllCollapsesallthenodesincludingallchildnodesinthetreeviewcontrol.
2ExpandAllExpandsallthenodes.
3GetNodeAtGetsthenodeatthespecifiedlocation.
4GetNodeCountGetsthenumberoftreenodes.
5SortSortsalltheitemsinthetreeviewcontrol.
6ToStringReturnsastringcontainingthenameofthecontrol.
EventsoftheTreeViewControlThefollowingaresomeofthecommonlyusedeventsoftheTreeViewcontrol:S.
NEventDescription1AfterCheckOccursafterthetreenodecheckboxischecked.
2AfterCollapseOccursafterthetreenodeiscollapsed.
3AfterExpandOccursafterthetreenodeisexpanded.
4AfterSelectOccursafterthetreenodeisselected.
5BeforeCheckOccursbeforethetreenodecheckboxischecked.
6BeforeCollapseOccursbeforethetreenodeiscollapsed.
7BeforeExpandOccursbeforethetreenodeisexpanded.
8BeforeLabelEditOccursbeforethetreenodelabeltextisedited.
9BeforeSelectOccursbeforethetreenodeisselected.
10ItemDragOccurswhentheuserbeginsdragginganode.
11NodeMouseClickOccurswhentheuserclicksaTreeNodewiththemouse.
12NodeMouseDoubleClickOccurswhentheuserdouble-clicksaTreeNodewiththemouse.
13NodeMouseHoverOccurswhenthemousehoversoveraTreeNode.
14PaddingChangedOccurswhenthevalueofthePaddingpropertychanges.
15PaintOccurswhentheTreeViewisdrawn.
16RightToLeftLayoutChangedOccurswhenthevalueoftheRightToLeftLayoutpropertychanges.
17TextChangedOccurswhentheTextpropertychanges.
TheTreeNodeClassTheTreeNodeclassrepresentsanodeofaTreeView.
EachnodeinaTreeViewcontrolisanobjectoftheTreeNodeclass.
TobeabletouseaTreeViewcontrolweneedtohavealookatsomecommonlyusedpropertiesandmethodsoftheTreeNodeclass.
PropertiesoftheTreeNodeClassThefollowingaresomeofthecommonlyusedpropertiesoftheTreeNodeclass:S.
NPropertyDescription1BackColorGetsorsetsthebackgroundcolorofthetreenode.
2CheckedGetsorsetsavalueindicatingwhetherthetreenodeisinacheckedstate.
3ContextMenuGetstheshortcutmenuthatisassociatedwiththistreenode.
4ContextMenuStripGetsorsetstheshortcutmenuassociatedwiththistreenode.
5FirstNodeGetsthefirstchildtreenodeinthetreenodecollection.
6FullPathGetsthepathfromtheroottreenodetothecurrenttreenode.
7IndexGetsthepositionofthetreenodeinthetreenodecollection.
8IsEditingGetsavalueindicatingwhetherthetreenodeisinaneditablestate.
9IsExpandedGetsavalueindicatingwhetherthetreenodeisintheexpandedstate.
10IsSelectedGetsavalueindicatingwhetherthetreenodeisintheselectedstate.
11IsVisibleGetsavalueindicatingwhetherthetreenodeisvisibleorpartiallyvisible.
12LastNodeGetsthelastchildtreenode.
13LevelGetsthezero-baseddepthofthetreenodeintheTreeViewcontrol.
14NameGetsorsetsthenameofthetreenode.
15NextNodeGetsthenextsiblingtreenode.
16NodesGetsthecollectionofTreeNodeobjectsassignedtothecurrenttreenode.
17ParentGetstheparenttreenodeofthecurrenttreenode.
18PrevNodeGetstheprevioussiblingtreenode.
19PrevVisibleNodeGetsthepreviousvisibletreenode.
20TagGetsorsetstheobjectthatcontainsdataaboutthetreenode.
21TextGetsorsetsthetextdisplayedinthelabelofthetreenode.
22ToolTipTextGetsorsetsthetextthatappearswhenthemousepointerhoversoveraTreeNode.
23TreeViewGetstheparenttreeviewthatthetreenodeisassignedto.
MethodsoftheTreeNodeClassThefollowingaresomeofthecommonlyusedmethodsoftheTreeNodeclass:S.
NMethodName&Description1CollapseCollapsesthetreenode.
2ExpandExpandsthetreenode.
3ExpandAllExpandsallthechildtreenodes.
4GetNodeCountReturnsthenumberofchildtreenodes.
5RemoveRemovesthecurrenttreenodefromthetreeviewcontrol.
6ToggleTogglesthetreenodetoeithertheexpandedorcollapsedstate.
7ToStringReturnsastringthatrepresentsthecurrentobject.
ExampleInthisexample,letuscreateatreeviewatruntime.
Let'sdoubleclickontheFormandputthefollowcodeintheopenedwindow.
PublicClassForm1PrivateSubForm1_Load(senderAsObject,eAsEventArgs)HandlesMyBase.
Load'createanewTreeViewDimTreeView1AsTreeViewTreeView1=NewTreeView()TreeView1.
Location=NewPoint(10,10)TreeView1.
Size=NewSize(150,150)Me.
Controls.
Add(TreeView1)TreeView1.
Nodes.
Clear()'CreatingtherootnodeDimroot=NewTreeNode("Application")TreeView1.
Nodes.
Add(root)TreeView1.
Nodes(0).
Nodes.
Add(NewTreeNode("Project1"))'CreatingchildnodesunderthefirstchildForloopindexAsInteger=1To4TreeView1.
Nodes(0).
Nodes(0).
Nodes.
Add(New_TreeNode("SubProject"&Str(loopindex)))Nextloopindex'creatingchildnodesundertherootTreeView1.
Nodes(0).
Nodes.
Add(NewTreeNode("Project6"))'creatingchildnodesunderthecreatedchildnodeForloopindexAsInteger=1To3TreeView1.
Nodes(0).
Nodes(1).
Nodes.
Add(New_TreeNode("ProjectFile"&Str(loopindex)))Nextloopindex'Setthecaptionbartextoftheform.
Me.
Text="tutorialspoint.
com"EndSubEndClassWhentheabovecodeisexecutedandrunusingStartbuttonavailableattheMicrosoftVisualStudiotoolbar,itwillshowthefollowingwindow:Youcanexpandthenodestoseethechildnodes:Loading[MathJax]/jax/output/HTML-CSS/jax.
js

pacificrack:2021年七夕VPS特别促销,$13.14/年,2G内存/2核/60gSSD/1T流量,支持Windows

pacificrack官方在搞2021年七夕促销,两款便宜vps给的配置都是挺不错的,依旧是接入1Gbps带宽,KVM虚拟、纯SSD raid10阵列,支持包括Linux、Windows 7、10、server2003、2008、2012、2016、2019在内多种操作系统。本次促销的VPS请特别注意限制条件,见本文末尾!官方网站:https://pacificrack.com支持PayPal、支...

virmach:3.23美元用6个月,10G硬盘/VirMach1核6个月Virmach

virmach这是第二波出这种一次性周期的VPS了,只需要缴费1一次即可,用完即抛,也不允许你在后面续费。本次促销的是美国西海岸的圣何塞和美国东海岸的水牛城,周期为6个月,过后VPS会被自动且是强制性取消。需要临时玩玩的,又不想多花钱的用户,可以考虑下!官方网站:https://www.virmach.comTemporary Length Service Specials圣何塞VPS-一次性6个...

LightNode(7.71美元),免认证高质量香港CN2 GIA

LightNode是一家位于香港的VPS服务商.提供基于KVM虚拟化技术的VPS.在提供全球常见节点的同时,还具备东南亚地区、中国香港等边缘节点.满足开发者建站,游戏应用,外贸电商等应用场景的需求。新用户注册充值就送,最高可获得20美元的奖励金!成为LightNode的注册用户后,还可以获得属于自己的邀请链接。通过你的邀请链接带来的注册用户,你将直接获得该用户的消费的10%返佣,永久有效!平台目前...

vbscript教程为你推荐
苏州商标注册苏州商标注册怎么办理找不到光驱为什么我的电脑光驱找不到?天府热线劲舞团(四川天府热线)为什么越来越卡了??手游运营手册剑三的方士使开启阴阳之力凝聚而成的魂匣怎么做啊 有详细说明吗站长故事部队里什么是站长?最低是什么级别?都有哪些级别啊?微信如何建群微信怎么建立群1433端口怎么开启本机1433端口qq怎么发邮件如何通过QQ发送邮件人人逛街包公免费逛街打一成语机械键盘轴机械键盘什么轴好,机械键盘轴有几种
ip代理地址 域名备案信息查询 bash漏洞 日志分析软件 ev证书 东莞服务器 新世界服务器 根服务器 路由跟踪 mteam 七十九刀 WHMCS winserver2008下载 卡巴下载 iptables 赵荣 ddos攻击工具 大容量存储控制器驱动 网站服务器硬件配置 代理服务器是什么 更多