I have a main form frmMain containing a button button1
I have another form frmNew containing a textbox txtBox1 and a button button2.
I have the following code behind the button button2 in frmNew:
Messagebox.Show(txtBox2.Text.tostring());
I have the following code behind the button button1 in frmMain:
frmMain frm = new frmNew();
Button btn = frm.button2;
this.InvokeOnClick(btn, EventArgs.Empty);
When application is launched; both forms a re displayed on the screen. I
entered a "My Text Message" in the frmNew's textbox txtBox1 and then went to
frmMain and clicked the button button1 which invoked the click event on
frmNext to display the message box
The code above displays the messagebox but it is blank; it should display
"John Doe" but doesn't. Please help!!!