Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear friends i have some forms my first form is login where user can enter with username and password
friends i am receiving username of related user in the main form and my form more child forms i want to retrieve the username in other forms which is opening from main form
Posted
Updated 26-Oct-15 6:23am

1 solution

So set up a property or method in the other forms and pass it through when the user logs in.

Alternatively (and I don't recommend this) you could set it as a static variable in your main form (or a static class) and access it that way from any form.
 
Share this answer
 
Comments
Muhammad Qasim Ludin 26-Oct-15 12:39pm    
i did the same work but some time i am getting the correct username but some time i getting (admin) username not which user is login now
Richard Deeming 26-Oct-15 13:16pm    
Is this an ASP.NET application?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900