Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i select a node in a treeview? 1

Status
Not open for further replies.

lminmei

Programmer
Feb 1, 2000
111
0
0
US
here's my treeview:

ParentNode
- Childnode

i want to select the childnode by code when i first start the application....
there is no "select" method for the treeview...
can someone help?
 
Code:
        private void Form1_Load(object sender, EventArgs e)
        {
            TreeNode Root = treeView1.Nodes.Add("Root");
            TreeNode Child = Root.Nodes.Add("Child");
            treeView1.SelectedNode = Child;
        }

*Note: Using C# 2005 express

Have Fun, Be Young... Code BASIC
-Josh

cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top