current user

  • Thread starter Thread starter karim
  • Start date Start date
K

karim

Hi everyone
I am trying to have the current user name that is logged in to be displayed
in a label or text box in the form. I need some help with the cod to get the
user name.
Thanks for you help...
 
thank you very much, works great. but I have to click on the label to view
the user name. is there any way to have it show when you open the form with
out clicking the label?
thanks
 
thank you very much, works great. but I have to click on the label to view
the user name. is there any way to have it show when you open the form with
out clicking the label?
thanks

There's no obligation to put "Label1.Text=My.User.Name" on label's
click event. As you wanted, you can put the code on form's load event
to see UserName in Label1 like this:

Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = My.User.Name
End Sub

Hope this helps,

Onur Güzel
 
Hi everyone
I am trying to have the current user name that is logged in to be displayed
in a label or text box in the form. I need some help with the cod to get the
user name.
Thanks for you help...

As far as I know cod is a good fish to eat but I don't think they know
a lot about DSP.


Hardy
 
Back
Top