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.

Re: Help with TreeView by Jeff

Jeff
Thu Apr 22 03:52:52 CDT 2004

On Wed, 21 Apr 2004 15:11:01 -0700, "Troy"
<anonymous@discussions.microsoft.com> wrote:

>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
}

--
Jeff Gaines - Damerham Hampshire UK