Click here to Skip to main content
15,914,111 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Somebody help me on How to get values on textbox in form1 into textbox in form2 in windows application.
Posted

 
Share this answer
 
If you look at the article Ankur linked too it has quite a low score - the reason is it contains some bad practices which are best avoided!

I posted a Tip here[^] which shows you how to do it correctly and an in depth article here[^].
 
Share this answer
 
take 2 forms form1.cs and form2.cs with one textbox on each forms and then change the modifier property of the textbox on each form from private to public add a button to form1.cs generate its click event by double clicking the button on form1 and then add in the following code in the click event of the button
Form2 obj = new Form2();
obj.textbox1.Text = this.textbox1.Text;
obj.Show();
this.Hide();

and then run the application

Do rate my answer once you find it useful

Thanks & Regards
Radix :rose:
 
Share this answer
 
Comments
Adesina Mark 11-May-10 14:19pm    
I have gotten a very good way of doing it. I have it on my blog:http://adesinaomoniyi.blogspot.com/2010/05/how-to-pass-textbox-values-on-one-form.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900