Mischamel Posted July 22, 2003 Posted July 22, 2003 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 ??? Quote Sometimes you´ve got to make a silent Takedown .
Mischamel Posted July 22, 2003 Author Posted July 22, 2003 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 Quote Sometimes you´ve got to make a silent Takedown .
*Experts* Volte Posted July 22, 2003 *Experts* Posted July 22, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.