المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : windows application



C# Programming
06-08-2010, 09:40 PM
Hi Everyone, I have an application that has at least two forms and a Class. how do I access variable between two forms without initializing all varialbes each time I access the class.
this is how I access functions form the Class

In Form1 I do this:

ClassA myClass = new ClassA();

myClass.Function_A();

// do something with it.

IN Form2

ClassA myClass2 = new ClassA();
myClass2.Function_B();
// do something with it.

how do i prevent ClassA funtions from reinitializing all over again. I want to treat the ClassA's funtions and variables like Global variable.

Thanks
"Show me the way I will get there"