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

创梦网络-四川一手资源高防大带宽云服务器,物理机租用,机柜资源,自建防火墙,雅安最高单机700G防护,四川联通1G大带宽8.3W/年,无视UDP攻击,免费防CC

? ? ? ?创梦网络怎么样,创梦网络公司位于四川省达州市,属于四川本地企业,资质齐全,IDC/ISP均有,从创梦网络这边租的服务器均可以****,属于一手资源,高防机柜、大带宽、高防IP业务,另外创梦网络近期还会上线四川联通大带宽,四川联通高防IP,一手整CIP段,四川电信,联通高防机柜,CN2专线相关业务。成都优化线路,机柜租用、服务器云服务器租用,适合建站做游戏,不须要在套CDN,全国访问快...

RackNerd:美国便宜VPS,洛杉矶DC-02/纽约/芝加哥机房,4TB月流量套餐16.55美元/年

racknerd怎么样?racknerd美国便宜vps又开启促销模式了,机房优秀,有洛杉矶DC-02、纽约、芝加哥机房可选,最低配置4TB月流量套餐16.55美元/年,此外商家之前推出的最便宜的9.49美元/年套餐也补货上架,同时RackNerd美国AMD VPS套餐最低才14.18美元/年,是全网最便宜的AMD VPS套餐!RackNerd主要经营美国圣何塞、洛杉矶、达拉斯、芝加哥、亚特兰大、新...

御云(RoyalYun):香港CN2 GIA VPS仅7.9元每月起,美国vps仅8.9/月,续费同价,可叠加优惠

御云怎么样?炎炎暑期即将来临,御云(royalyun)香港、美国服务器开启大特惠模式。御云是新成立的云服务提供商,主要提供香港、美国的云服务器,不久将开启虚拟主机业务。我们的香港和美国主机采用CN2 GIA线路。目前,香港cn2 gia vps仅7.9元每月起,美国vps仅8.9/月,续费同价,可叠加优惠,香港云服务器国内延迟一般在50ms左右,是搭建网站的最佳选择,但是请不要用于违法用途。点击进...

vbscript教程为你推荐
刷网站权重如何刷流量才能提高网站权重iphone5解锁iphone5怎么解锁如何免费开通黄钻怎么免费开通黄钻深圳公交车路线深圳公交车路线查询快速美白好方法有什么快速美白的好办法吗?bluestacksBluestacks安卓模拟器是什么机型的?直播加速请问哪种播放器的可以播放加速,并且可以保存神雕侠侣礼包大全神雕侠侣手游华山论剑礼包有什么 怎么领取ios7固件下载iphone自动下载IOS7固件版本怎么删除人人逛街包公免费逛街打一成语
重庆域名注册 日本动态vps 域名备案只选云聚达 免费申请网页 香港托管 debian7 蜗牛魔方 微信收钱 admit的用法 免费测手机号 万网空间购买 smtp服务器地址 主机管理系统 cc攻击 dns是什么意思 装修瓦工培训 天鹰抗ddos防火墙 主机游戏 电脑主机配置 电脑主机打不开 更多