I use FindForm to get the Parent Object but the Object Members/Properties do not include access to the "public textBox1":
Code:
void button_click(System::Object^ sender, System::EventArgs^ e){
Control^ ctrl = safe_cast<Control^>(sender);
Form^ myForm = ctrl->FindForm();
MessageBox::Show(myForm->Name,"The Name"); // works
myForm->textBox1->Text = gcnew String("Hello"); // does not work
}
error C2039: 'textBox1' : is not a member of 'System::Windows::Forms::Form'
Yes, you can guess... I am trying to access it outside the class, which is why I do not simply use this->textBox1 - the call is made with:
this->Go->Click += gcnew System::EventHandler(button_click);
Any insights? Thanks.