In Visual Studio 2010, can you automatically generate an event handler just like C # using Visual Basic?

For example, you can type this.Loaded +=in C # and press TAB several times to automatically generate an event handler. Does Visual Basic have an equivelent?

Entering Addhandler Me.Loadedand pressing TAB or RETURN does nothing.

+3
source share
1 answer

The VB.NET IDE has a different approach based on the WithEvents keyword. Notice the two combo boxes at the top of the editor window. You select (the Events class) in the upper left corner, the event that you want to subscribe in the upper right field. This automatically generates an event handler; it has the Handles keyword.

No help for the explicit AddHandler statements that I know of.

+3
source

Source: https://habr.com/ru/post/1744932/


All Articles