This is my first winform app in .NET… I have made a couple of ASP.NET app…
In this app, I have some common variables, like current user name, his selected process etc.. etc.. This should be made accessible from all forms in the app at any time… How could I do this… Is there any place like “Session” in ASP.NET here…
Further How do coders generally pass information from one form to another… Here I want to pass on the info I acquired in the first form to the subsequent forms… I use constructor overloading and pass the values as parameters… I’m pretty sure there has to be a better way to do it…
Thanks for your time…
You might want to implement a Singleton object
Implementing the Singleton Pattern in C#
This is typically used for thread safe code, but will also allow you to access the same instance from multiple forms, allowing you to use the same data without having to pass the object around from form to form.