- This topic has 1 reply, 2 voices, and was last updated 13 years, 5 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- The forum ‘C# Programming’ is closed to new topics and replies.
Home › Forums › C# Programming › Global module in C#
I was wandering if someone could tell me how to create a global module for showing/closing a form, like you would do in Visual Basic, and then how to call that module.
There is no such thing in C# instead you can create a public class in any namespace with Static Members functions like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <br /> namespace GlobalFunctions //You can name it anything you want<br /> {<br /> public class ClassName //Name your class<br /> {<br /> ClassName bers() {} // Constructor for class<br /> public static bool AnyFunction()<br /> {<br /> return true;<br /> }<br /> }<br /> }<br /> <br /> //Use it in Other classes<br /> using GlobalFunctions<br /> bool isTrue = ClassName.anyFunction();<br /> |