Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send str from 2nd form to txtBox in main form?

Status
Not open for further replies.

fdpelli

Technical User
Sep 12, 2003
5
0
0
SE
Hello

I wonder how I set the txtText in frmMain to be equal to a string in frmChild?

Like this: frmMain.txtText.Text = strText

/ Per aspera ad astra
 
Remember that in .NET, all forms are really objects.

If you want to set a property in an instance of some object, you have to have a reference to that object.

Same thing in this case - your frmChild needs a reference to frmMain before it can set a public property or call a public method on it. When you initially create frmChild, you'll need to pass it a copy of your frmMain's variable that you can then use later.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Ok. Thank you very much, I think I understand.

/ Per aspera ad astra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top