||Carlos J. Quintero (Microsoft MVP)
||Microsoft Visual Studio .NET 2002
||Microsoft Visual Studio .NET 2003
||Microsoft Visual Studio 2005
The OnChange event of the EnvDTE.SelectionEvents class fires each time you
select something different in the IDE. For example, if you multi-select a second
file in the Solution Explorer, the event is fired. However, it does not fire
when you multi-select a third item in the Solution Explorer.
This seems to be a bug of Visual Studio.
Steps to reproduce the problem:
- Open the Macros IDE, go to the EnvironmentEvents file, select the
SelectionEvents item in the combobox to the left and the OnChange event in
the combobox to the right. This creates the event handler for that event.
Add this code:
Public Sub SelectionEvents_OnChange() Handles SelectionEvents.OnChange
- Go back to the Visual Studio IDE and create a project.
- Expand the References node in the Solution Explorer.
- Select a reference in the Solution Explorer and notice that the
SelectionEvents.OnChange event is fired (you see the message box).
- Multi-select (with the Ctrl key) a second reference and notice that the
event is fired again. Now you have two items selected.
- Multi-select a third reference and notice that the event is not fired
Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this