Groups | Blog | Home
all groups > c# > november 2007 >

c# : multiple forms


.\\\\axxx
11/19/2007 3:08:00 PM
[quoted text, click to view]

As long as your methods, variables (make that properties) and data
source are public, you can access them from the main form..

mySecondForm.DoSomething();
int x = mySecondForm.AProperty;

Remember that the object you define in the main form

myForm mySecondForm = new MyForm();

will need to be given sufficient scope so that you have access to
it... e.g. don't make it local ot the button click event unless that's
where you want all the processing to be.

ulazar
11/19/2007 10:26:34 PM
I would like to open a form from a button in the principal form. Ok
that's easy...the problem is that I want to use methods, variables of
AddThis Social Bookmark Button