Visual C++ accessing components on other form
Hi I am Chris and I'm working on an application with more than 1 form. I have a List View and a Tree View on form1, a button and a Text Box on form2. The flow is when I click the button on form2 the Tree View on form1 will create a new node. I've tried this: but it generates error.
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Form1->treeView1->Nodes->Add(textBox1->Text);
}
What should I do?
Thank you very much.
|