How to define global variable in C#

Jul 13 2006 8:05 AM
Hi all,

Please help me solving following query:

How to add global variable in C# window base application. This variable must be accessible to all forms.

What I exactly want is:

I have a variable "UserName" and "UserType". When user click "Submit" button on Login form, user name get stored in variable "UserName" and user type get stored in variable "UserType". After click "Submit" button Login form get closed and "Project" form get open.

On "Project" form there are label "User Name" and "User Type". When "Project" form get open, the value of "UserName" and "UserType" variable should be get displayed in front of these labels.

I hope you understand my question.

Thanks and regards,

Swapnil.

Answers (2)