Back in the day, you use to be able to override an event in VB by using the drop down list in the code window. Today, I had a friend who is moving from Visual Studio 2003 to Visual Studio 2008 ask me, “How do I override events in VB.NET now?” All you get in the drop downs now is the event handlers.
Well, I’ll be honest here. I had no idea that was even an option.
It turns out that the best way to automatically override events using VB.NET now is to make use of the Intellisense everywhere feature.
If you type in, “prot”, you can select “protected” from the list. Press the space bar and then type in “overr” and select “overrides” from the list. One more space and the list of overridable functions appear. Select one and press tab to get the function all stubbed out for you.
It’s not quite the same, but I think in the end it may actually be faster than using the drop down list boxes at the top of the edit screen.
Other post in VB.NET
- Assign Multiple enum Values To One Variable - November 2nd, 2007
- Object Initialization in CSharp 3.0 and VB.NET 9 - November 28th, 2007
- The VB.NET Ternary Operator - November 29th, 2007
- UnauthorizedAccessException writing to HKLM - April 8th, 2008
- Overriding Events in VB.NET - May 8th, 2008
- VB.NET - Char from String with Option Strict - April 8th, 2009
- .Net String Pool – Not Just For The Compiler - April 22nd, 2009
- Manually Adding Event Handlers in VB.NET - July 15th, 2009
- VB.NET Processing Before WinForm Display - August 6th, 2009
- Decimal vs Float (Single) or Double - September 18th, 2012
- VB.NET Hide Module Name - August 28th, 2013
- VB.NET Nullable Types - January 15th, 2014