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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying to pass parameter from one form to another.

Status
Not open for further replies.

Smitty020

MIS
Jun 1, 2001
152
US
I have a text box on one form for which I want to use to bring up values on a new form when it is loaded.

Therefore: The "string" value in txtCompany on form1 will need to be passed to form2 when it is loaded.

I have this as the code under the load event for form2:

Form1 frm1 = new Form1();
string Company = frm1.txtCompany.Text.ToString();


This compiles without a problem, however a blank string gets passed when form2 loads instead of the string from the textbox.

Can anyone help?

Thanks in advance,

Smitty
 
Please do a search.
This has been answered many many times.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
No problem!

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I'm looking for the same answer, but I am not finding it. Do you have the FAQ #?
 
Take a look at thread732-903616

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top