Sharing variables across Forms

  • Thread starter Thread starter Denis_dh
  • Start date Start date
D

Denis_dh

Hi,


I have a set of Forms and wish to have a varible used by more than one
of them but can't seem to figure where to initialise it or how to
acess it if I initialise it in a different form than the one that is
accessing it!

Any help appreciated!
Denis
 
Create a class and declare public static variable.
You can use these variable across the project.

Regards,
Amal
 
Dennis,

I don't like this, however when you want it can you make your own class with
static variables.
Know that than every class that uses those is directly depended from that
class.

MessageBox.Show(Myname.I);
\\\
public class Myname
{
static public string I = "Cor";
}
///

I don't like it.

Cor
 
Back
Top