Hi All,
What's the different between a treeView declared like:
and a treeNode declared like:Code:this.treeView1 = new System.Windows.Forms.TreeView();
I found out how to access the TreeNode:Code:System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("Rond 1");
But why can I access a node declared like this in a different class than the form class:Code:TreeNode tn1 = this.treeView1.Nodes[0];
But not in the form class where the node is declared in the Form1.Designer.cs class like this:Code:System.Windows.Forms.TreeNode treeNode666 = new System.Windows.Forms.TreeNode("Kalle"); treeNode666.Text = "Stig";
And I want to access the Node I as I did above:Code:System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("Rond 1");
Why does it work in the other class, but in the form class where I get 'The name 'treeNode10' does not exist in the current context' error?Code:treeNode10.Text = "Stig";
Regards
Jonni




Reply With Quote