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

vdsina:俄罗斯VPS(datapro),6卢布/天,1G内存/1核(AMD EPYC 7742)/5gNVMe/10T流量

今天获得消息,vdsina上了AMD EPYC系列的VDS,性价比比较高,站长弄了一个,盲猜CPU是AMD EPYC 7B12(经过咨询,详细CPU型号是“EPYC 7742”)。vdsina,俄罗斯公司,2014年开始运作至今,在售卖多类型VPS和独立服务器,可供选择的有俄罗斯莫斯科datapro和荷兰Serverius数据中心。付款比较麻烦:信用卡、webmoney、比特币,不支持PayPal...

提速啦(69元起)香港大带宽CN2+BGP独享云服务器

香港大带宽服务器香港大带宽云服务器目前市场上可以选择的商家十分少,这次给大家推荐的是我们的老便宜提速啦的香港大带宽云服务器,默认通用BGP线路(即CN2+BGP)是由三网直连线路 中国电信骨干网以及HGC、NTT、PCCW等国际线路混合而成的高品质带宽(精品带宽)线路,可有效覆盖全球200多个国家和地区。(适用于绝大部分应用场景,适合国内外访客访问,域名无需备案)提速啦官网链接:点击进入香港Cer...

PQS彼得巧 年中低至38折提供台湾彰化HiNet线路VPS主机 200M带宽

在六月初的时候有介绍过一次来自中国台湾的PQS彼得巧商家(在这里)。商家的特点是有提供台湾彰化HiNet线路VPS主机,起步带宽200M,从带宽速率看是不错的,不过价格也比较贵原价需要300多一个月,是不是很贵?当然懂的人可能会有需要。这次年中促销期间,商家也有提供一定的优惠。比如月付七折,年付达到38折,不过年付价格确实总价格比较高的。第一、商家优惠活动年付三八折优惠:PQS2021-618-C...

vbscript教程为你推荐
9flashIE9flash模块异常。godaddyGodaddy域名怎么接受怎么点亮qq空间图标怎么点亮QQ空间的图标机械键盘轴大家觉得机械键盘什么轴最舒服iphone6上市时间苹果6是什么时候出的 ?iphone6上市时间苹果6什么时候出?gbk编码表GBK码表怎么查王炳坤南北小年为何不同日空间装扮免费空间还有那些装扮是免费的?联网核查公安联网核查公民信息 都能查到什么信息 要全的
北京虚拟主机 西安虚拟主机 虚拟主机排名 域名投资 securitycenter 免备案空间 美国php主机 河南服务器 e蜗牛 qq数据库下载 免费网站申请 骨干网络 上海域名 京东商城0元抢购 已备案删除域名 世界测速 免费测手机号 银盘服务是什么 万网注册 godaddy空间 更多