Global Variable
-
I have a login box with Validation against a Password database I would like to use the UserNo. in another form I have menthod Public sub frmLogin(Byval Userno as String) dim login as integer login = Cint(Log) { Now how do use that login variable in another form)
-
I have a login box with Validation against a Password database I would like to use the UserNo. in another form I have menthod Public sub frmLogin(Byval Userno as String) dim login as integer login = Cint(Log) { Now how do use that login variable in another form)
Have a look at this article: passingvaluesbetweenforms[^]
#region signature my articles #endregion
-
I have a login box with Validation against a Password database I would like to use the UserNo. in another form I have menthod Public sub frmLogin(Byval Userno as String) dim login as integer login = Cint(Log) { Now how do use that login variable in another form)
Create a property on this form that exposes the user no. The access that property from the other form before closing this one. You only hide the login form when done, and close or dispose it after reading the property.
-
Create a property on this form that exposes the user no. The access that property from the other form before closing this one. You only hide the login form when done, and close or dispose it after reading the property.
That not so helpful But Thanks Any Code to support your Written disscussion
-
Have a look at this article: passingvaluesbetweenforms[^]
#region signature my articles #endregion
Thanks So Much You Rock
-
Thanks So Much You Rock
You are welcome :)
#region signature my articles #endregion
-
That not so helpful But Thanks Any Code to support your Written disscussion
It's only not helpful if you choose to not explore what I said.
-
I have a login box with Validation against a Password database I would like to use the UserNo. in another form I have menthod Public sub frmLogin(Byval Userno as String) dim login as integer login = Cint(Log) { Now how do use that login variable in another form)
If you want to use valid login name on another form after user authentication the you can create a public property on your another form and fill it with the value by accessing it before opening that form. Ex:--> if you are on "login.cs" and want to open "Admin.cs" then code for admin will have a public property say "UserNo" Private int userNo; Public property int UserNo { get { return userNo;} set { userNo = value;} } Now on login.cs after user validation Admin admin = new Admin() (( This depends opn your architecture)) admin.UserNo = login; admin.ShowDialog(); This way the user no will be available as per code optimization also. vims