Yes. One way is to set the Modifiers property of any control you want to
access on form1 to Internal or Public. Make sure you pass a reference to
form1 into form2, then, for example, use the line:
form1.TextBox1.Text = "NewText";
Tom Clement
In the form1, have a button to be clicked to create form2,
and in the form2, have a textbox to let user input some
data.Is there some way to let the form1 receive the input
data or to change some variable(data) in the form1 after
user input some data in the form2?
.....
{
...
m_frmForm1.TextBox1.Text = "New Text";
}
form2 -- end code --
now in form1 -- start code --
.....
form2 myForm2 = new myForm2();
myForm2.MyForm1 = this;
form1 -- end code --
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.