How to pass value from one Form to another Form in Windows Applicationj
Posted by
vishalneeraj-24503 under
C# on 11/12/2013 5:14:54 AM |
Points: 75 | Views : 1638 | Status :
[Member] [MVP]
With the help of Form' Tag property, we can pass values from 1 form to another
In Form One, any event
private void btn_submit(Object sender, Eventargs e)
{
try
{
Form1 obj = new Form1();
obj.Tag = txt_username.Text.Trim();
}
catch(Exception ex)
{
throw ex;
}
}
In Form Two,
private void Form2_Load()
{
Form1 obj = new Form1();
lbl_user_name.Text = obj.Tag;
}