skip to Main Content

I want at runtime to click on my label and change its text, how to do that?

Private Sub BapAra_KeyPress(sender As Object, e As KeyPressEventArgs) Handles MyBase.KeyPress
        Label1.Text &= e.KeyChar
    End Sub

2

Answers


  1. Since you want to change the text when the label is Clicked, your event should occur on the BUTTON-NAME-ONCLICK() event and not on the keypress event…

    Login or Signup to reply.
  2. Use a TextBox with an invisible border instead.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search