0

Hi there !

I have a tree view control and a button in Form1. The button takes me to Form2 which has a text box and a save button.

What I'm trying to do is get the button on Form2 to add what i have typed in the textbox as a tree node in Form 1

I'm completely stumped and any advice / code snippets that could get me started on solving this problem would be greatly appreciated.

Thanks !

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by __avd
1

Set the property TextBox1.Modifiers=Public on Form2.

Form1

...
    private void button1_Click(object sender, EventArgs e)
        {
            Form2 f = new Form2();
            f.ShowDialog();
            treeView1.Nodes.Add(f.textBox1.Text);
        }
 ...

Form2

...
private void button1_Click(object sender, EventArgs e)
        {
          Close();
        }
...
0

that works great !

thanks a lot for the speedy reply !

0

Thanks! Please mark this thread as solved if you have found an answer to your question and good luck!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.