How to get a list of all child nodes in a TreeView in .NET

后端 未结 10 1083
抹茶落季
抹茶落季 2020-12-15 21:28

I have a TreeView control in my WinForms .NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a use

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 21:38

    Usually get a value at the specified node is interesting to programmers.This can be obtained as follows.Assumes that you have a TextBox control named texbox1 and a TreeView control named treeview1.Following would return the value of text at nodes level 0.

    textbox1.Text = treeview1.nodes(0).Text.ToString()
    

提交回复
热议问题