Hi friends,
I want to send a link which is stored in a string variable to another form. please tell me how can i code it.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Mar 12, 2012, 4:47 AM
You can send the value as arqument.
Form2 frm2 = new Form2(this.textBox1InForm1.Text);
frm2.ShowDialog();
In the form2, you need to write the constructor.
public Form2(string strParam)
{
InitializeComponent();
this.textBox1_InForm2.Text=strParam;
}
Please refer these link.
http://www.c-sharpcorner.com/UploadFile/thiagu304/passdata05172006234318PM/passdata.aspx
http://www.c-sharpcorner.com/UploadFile/alindag/HowToPassValuesBetweenWindowsForms.htm02242006061520AM/HowToPassValuesBetweenWindowsForms.htm.aspx
If it is useful then mark it as Accept answer.
Zeb RehmanPosted Mar 12, 2012, 5:56 AM