WinForms "Session" variable?


Is there anything similar to the WebForms Session variable for WinForms? I want to add enter to a database by following a Wizard style form appearing after the can i carry the value of a field?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kokas79Author Commented:
What i've done so far is have all my forms inherit from a Template form and declare a property in there to store the value of the field i'm interested in, so as to use it in each form.
Any other approach?
You can add static class member to the base class and keep required data in it.
Kokas79Author Commented:
is that with the Shared keyword in VB?
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Yes, static is from C#, in VB this is Shared keyword. There is only one Shared (static) class member for all class instances, shared class member is kind of global variable.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kokas79Author Commented:
thank you...i implemented some shared properties.
what about the Application variables in anything like that for Winforms?
I don't think that there are additional levels in Windows forms applications. Non-shared members are kept with every class instance, and shared member is one per application. If there are number of running application instances, there is not any relation between them (unless you want to implement this using some kind of interprocess communication).
Kokas79Author Commented:
ok...i get the point...WinForms suck! at least u dont have the postbacks.....:)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.