3
Contributors
2
Replies
22
Views
3 Years
Discussion Span
Last Post by nelsonfaboan.rios
0

well i'd recommend using delegates to pass values from one form to another form, as long as they are short, but if you need pass a lot more information, you can reference the form1 (the owner of the comunication) and then use the referenced object on the form2.

you can do it this way.

//lets supose you have an already defined form2 class

//here you pass the form1 or mainform by reference
Form2 form2=new Form2(this);


//and in your form2 you will have something like this

Form1 form1byreference;
//Constructor of the form2
public Form2(Form1 form1)
{
form1byreference=form1;
}

//and now you can obtain and even modify the form1 from the form2
//for example
form1byreference.Size=whatever you want;

Edited by nelsonfaboan.rios

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.