Hi there,
there is more than one way to do what you want -
1. You can declare a static variable of the main form's type at the main
form. So when it initializes, you can set the static variable to the
instance that's being created.
From there on, you can access the instance from the other forms.
2. You can pass a reference of the form that opens the second/third/etc form
while opening it. Then access the data that's being contained in it.
3. If you pass variables that are being passed by reference (that means
pretty much everything that is a class type of variable (without strings -
they are being copied always, exept when you pass them by ref), you don't
need to worrie about the amount of the data - you're passing just a
reference - that means that you'll copy only 4 bytes (for the address space
that's gonna be allocated on the stack).
If you want to pass vars that are not of a ref type, then use the ref
keyword for the parameter at function's argument list.
Cheers,
Branimir
--
Branimir Giurov
MCSD.NET, MCDBA, MCT
eAgility LLC
"Michael" <vo*****@hotmail.com> wrote in message
news:9jJhc.1106$0u6.400672@attbi_s03...
Hi, I am writting a C# application, not webform
My application has baseform and 4 other forms,
my problem is how to pass the value or data of the textbox from 1st form
to the label or listbox on the last form
all of the forms are inherted from the base form.
I know I can create a global variable but I have a lot of data to pass,
and another question, when I switch to different form, and I use
this.visible= flase
how do I write the code so the main page. visible will become true?