Follow the following steps to do the task of taking one value of a form to another form :-
Step 1: Under the click event
Create an object of the form where you want to take the value
form1 frm = new form1(TextBox1,text);// taking Value of textbox1 to another form
frm.show();
Step 2: On the second Form , in its constructor i.e.
Public Form1( String name)// since we taking string Value
{
Label1.Text = name; // display the name coming from last form into the label
}
And you are done.............................
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment