Discussion on:

Message 1 of 3
0 Votes
+ -
It can be convenient
However, there are a couple of gotchas. If you mix control types, you better use a typeof clause to make sure that your operating on the correct control type. Also, don't mistake the order that the events are listed in the handles clause as the order they will be handled in. There is no guarantee which event handler will be executed first.

Another thing, it maybe a good idea to list in a comment which controls should be listed in the handles clause. If you move a control in your form, sometimes VB.net will drop that control off the handles clause. Since the event handler may not be named the same as the control, it can be a bear trying to find out what happened.
Posted by alaniane@...
Updated - 19th Oct 2007