Game Development Community

nonTorque Related C#

by Chris Sargent · in Torque 3D Professional · 11/20/2011 (7:52 pm) · 4 replies

I know this isn't the area to post this in, but as we have no code section. I was wondering if anyone is fluent in C# and can tell me how to define a global variable in a windows form application.

Thanks in advance,

#1
11/20/2011 (9:32 pm)
I'm not sure that it's possible in C#. You can make it a property of your main form class and then other objects in your application can access it within the main application namespace, I think.
#2
11/20/2011 (11:06 pm)
Thanks Richard I will give that a shot. I was lost on how to procede.
#3
11/21/2011 (3:45 pm)
Use a static class. Check the link for an excellent example.

www.daniweb.com/software-development/csharp/threads/49952
#4
11/22/2011 (5:23 am)
Ah - wasn't thinking about static objects - good catch.