How do I declare global variables in Visual C#?
A public static field is probably the closest you will get to a global variable
public static class Globals
{
public static int MyGlobalVar = 42;
}
However, you should try to avoid using global variables as much as possible as it will complicate your program and make things like automated testing harder to achieve.