Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I´d like to know what the name of TExtBox_Click sub or function is ?? Does it work the same way as in vb6 ?? Or are there any other possibilities ???

Sometimes you´ve got to make a silent Takedown .
Posted

Just add the following code and it works :

 

Private Sub TextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Click

MsgBox("Klick")

 

End Sub

 

 

Bye

Sometimes you´ve got to make a silent Takedown .
  • *Experts*
Posted

There are two ways to attach an event handler in VB;

 

1) The Handles keyword. If you create a subroutine with the proper parameters for an event (one parameter for the sender object, one for the proper EventArgs for the event), you can simply append Handles MyObject.MyEvent to the end and it will become the event handler for that event.

Private Sub OnTextBox1Clicked(sender As Object, e As EventArgs) [u]Handles TextBox1.Click[/u]

 

2) The AddHandler keyword. If you create a subroutine with the proper parameters, you can use AddHandler to dynamically assign or remove an event handler to/from an event.

AddHandler OnTextBox1Click, AddressOf TextBox1.Click

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...