How do I declare global variables in Visual C#?
How about this
public static class Globals {
public static int GlobalInt { get; set; }
}
Just be aware this isn't thread safe. Access like Globals.GlobalInt
This is probably another discussion, but in general globals aren't really needed in traditional OO development. I would take a step back and look at why you think you need a global variable. There might be a better design.