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

RFCHOST - 洛杉矶CN2 GIA VPS季付23.9美元起 100Mbps带宽

RFCHOST,这个服务商我们可能有一些朋友知道的。不要看官网是英文就以为是老外服务商,实际上这个服务商公司在上海。我们实际上看到的很多商家,有的是繁体,有的是英文,实际上很多都是我们国人朋友做的,有的甚至还做好几个品牌域名,实际上都是一个公司。对于RFCHOST商家还是第一次分享他们家的信息,公司成立大约2015年左右。目前RFCHOST洛杉矶机房VPS正进行优惠促销,采用CN2优化线路,电信双...

pacificrack7月美国便宜支持win VPS,$19.99/年,2G内存/1核/50gSSD/1T流量

pacificrack发布了7月最新vps优惠,新款促销便宜vps采用的是魔方管理,也就是PR-M系列。提一下有意思的是这次支持Windows server 2003、2008R2、2012R2、2016、2019、Windows 7、Windows 10,当然啦,常规Linux系统是必不可少的!1Gbps带宽、KVM虚拟、纯SSD raid10、自家QN机房洛杉矶数据中心...支持PayPal、...

DiyVM:50元/月起-双核,2G内存,50G硬盘,香港/日本/洛杉矶机房

DiyVM是一家比较低调的国人主机商,成立于2009年,提供VPS主机和独立服务器租用等产品,其中VPS基于XEN(HVM)架构,数据中心包括香港沙田、美国洛杉矶和日本大阪等,CN2或者直连线路,支持异地备份与自定义镜像,可提供内网IP。本月商家最高提供5折优惠码,优惠后香港沙田CN2线路VPS最低2GB内存套餐每月仅50元起。香港(CN2)VPSCPU:2cores内存:2GB硬盘:50GB/R...

vbscript教程为你推荐
ip地址是什么Ip地址格式是什么?明星论坛怎么建免费的论坛网站?windows优化大师怎么用windows优化大师怎么用﹖无线路由器限速设置无线路由器能设置限速吗?或者说那个牌子的能。pw美团网电话是什么pw伪静态如何设置伪静态规则ps抠图技巧photoshop抠图技巧网店推广网站怎么免费推广淘宝店铺?安全漏洞什么是安全漏洞攻击??网站优化方案几种常用的网站优化方法
虚拟主机评测网 深圳域名空间 bandwagonhost 秒解服务器 la域名 表格样式 蜗牛魔方 架设服务器 789电视 腾讯实名认证中心 最好的qq空间 怎么建立邮箱 登陆空间 可外链的相册 supercache 免费网络空间 江苏徐州移动 睿云 乐视会员免费领取 阿里云邮箱怎么注册 更多