On Nov 20, 8:26 am, ulazar <ula...@XXXtin.itwrote:
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
principal application and access to data source from the second form.
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.
Cheers