Help with TreeView

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am building a project, in which I utilze the TreeView. Here's the explain as what I want to do

The Root TreeView Node is "Color", Below it I have "Red", "Green", "Yellow" as Child Nodes. Now when I click on "Red", I want a form with Red colored background to popup. The project is not quite this but, it's the same idea :-). Can you help me. Google, leads me to a lot of good articles but non help me out. Please advice

Color
|_Re
|_Gree
|_Yello

Please advice and Thanks for your help in advance.
 
I am building a project, in which I utilze the TreeView. Here's the explain as what I want to do:

The Root TreeView Node is "Color", Below it I have "Red", "Green", "Yellow" as Child Nodes. Now when I click on "Red", I want a form with Red colored background to popup. The project is not quite this but, it's the same idea :-). Can you help me. Google, leads me to a lot of good articles but non help me out. Please advice.

Colors
|_Red
|_Green
|_Yellow

Please advice and Thanks for your help in advance.

Trap the Treeview AfterSelect function and then read the Text of
the selected node:

private void treeView1_AfterSelect(object sender,
System.Windows.Forms.TreeViewEventArgs e)
{
textBox1.Text = e.Node.Text;
// Add code to show your coloured form here
}
 
Back
Top