Results 1 to 3 of 3

Thread: [RESOLVED] How to receive value in dynamic textbox on click

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    South Charleston, WV, USA
    Posts
    607

    Resolved [RESOLVED] How to receive value in dynamic textbox on click

    I have searched for an answer to this and can't find one. I have a panel with dynamically-created textboxes running down it. When the user clicks on one of the textboxes, I want to get the value in the textbox. I add an on-click event handler in my loop and when one of the textboxes on the panel is clicked the event fires and the sub is entered. I just don't know how to get the value in the textbox which was clicked once entering the subroutine.

    Code:
        Sub MyMessage(ByVal Sender As System.Object, ByVal e As System.EventArgs)
    ' What goes in here?
        End Sub

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: How to receive value in dynamic textbox on click

    Code:
    dim value as string = directcast(sender, textbox).text

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    South Charleston, WV, USA
    Posts
    607

    Re: How to receive value in dynamic textbox on click

    Works like a charm! Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width