current user

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?a2FyaW0=?=

    current user

    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...

  • Bill McCarthy

    #2
    Re: current user

    Hi Karim,

    label1.Text = My.User.Name


    "karim" <karim@discussi ons.microsoft.c omwrote in message
    news:611A31A9-1DD0-4E7E-9FC7-37858C16C130@mi crosoft.com...
    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...
    >

    Comment

    • =?Utf-8?B?a2FyaW0=?=

      #3
      Re: current user

      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

      Comment

      • kimiraikkonen

        #4
        Re: current user

        On Oct 3, 10:14 am, karim <ka...@discussi ons.microsoft.c omwrote:
        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(ByVa l sender As System.Object, _
        ByVal e As System.EventArg s) Handles MyBase.Load
        Label1.Text = My.User.Name
        End Sub

        Hope this helps,

        Onur Güzel

        Comment

        • HardySpicer

          #5
          Re: current user

          On Oct 3, 7:25 pm, karim <ka...@discussi ons.microsoft.c omwrote:
          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

          Comment

          Working...