Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do the handles on some events disapear?

Status
Not open for further replies.

iannuzzelli

Programmer
Jan 4, 2003
36
0
0
US
Sometimes in VB .NET 2003 the Handles on some events disapear. Any ideas?
 
Hi !

Such behaviour could be if use try handle event that has been hidden from event pages at VS (you could do it via Designer class).

Solution is inherit your class from base and show event which you wanna handle.
 
If you have an event handler for a control, and then remove and re-add the control from the form, the event will become 'unwired'.

For example, if you add a button to a form and double click on it, the code editor will create the following:

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

End Sub

Now delete the button from the form, and the code editor will now display:

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

This is because the procedure that was used to handle the button click event may still be valid, but the handling of Button1.Click is removed.

Adding a button back onto the form and calling it Button1 will not automatically rewire the handler, you need to do it manually.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top