Ver versión en español    
 
Home
10 Reasons to use MZ-Tools
MZ-Tools 6.0 for VS.NET
Editions
Features
Online Documentation
MZ-Tools SDK
Download
Purchase
Version History (RSS)  
FAQ & Support
MZ-Tools 3.0 for VB6 & VBA
Features
Online Documentation
Download (freeware)
Donations (Paypal)
Version History (RSS)  
FAQ & Support
User Reviews
Community Place
Contact  
For Add-In Developers
About
   
 
User Testimonials

I'm an avid supporter of MZ-Tools. It's a product I couldn't do without and your level of support is outstanding.

Jan Hyde (Visual Basic MVP)

You will soon wonder how you ever lived without it.

Andy Maggs

More user reviews
 
BUG: EnvDTE.SelectionEvents.OnChange event does not fire when more than two nodes are already selected in the Solution Explorer of Visual Studio

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio .NET 2002
Date: April 2007   Microsoft Visual Studio .NET 2003
      Microsoft Visual Studio 2005
Introduction

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.

Cause

This seems to be a bug of Visual Studio.

More Information

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
        MessageBox.Show("Change")
    End Sub
  • 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 this time.

Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this

MZ-Tools 6.0 for Visual Studio .NET

You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:

Buy MZ-Tools Now Download MZ-Tools Demo

   Top