Quantcast
Viewing all articles
Browse latest Browse all 12583

I want to access UserID publicly

hi,

I have a main form which a user first log in and the user's UserID will store in public int UserID; I want to access this UserID through main form in any form which I open.

I did the code like this:

MainForm

public int UserID; // gets the UserID when user log in

now for example I open FormA

MainForm mainForm;

int a = mainForm.UserID;

but it doesnt work

can any body tell me what is the problem or how to access the UserID from MainForm in all forms which I m opening?


Viewing all articles
Browse latest Browse all 12583

Trending Articles