Automation Model (EnvDTE) Enhancement: Accept .NET System.Drawing.Icon to set custom pictures in add-in commands and toolwindows - by Carlos J. Quintero

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 336868 Comments
Status Closed Workarounds
Type Suggestion Repros 1
Opened 4/4/2008 1:23:11 AM
Access Restriction Public


This is a reopen suggestion for

Add-Ins can create two UI elements that can have custom pictures:

- Buttons (from commands): the custom picture is set through the EnvDTE.Commands.AddNamedCommandBar method.
- Toolwindows: the custom picture is set through the EnvDTE.Window.SetTabPicture method.

The current APIs require a bitmap (not an icon) and have two problems that make this problem the #1 problem in forums (described below)

Sign in to post a comment.
Posted by Microsoft on 9/11/2009 at 2:20 PM
Hello Carlos,

I wanted to update the Connect bug that’s tracking your request with the final changes that were made to this feature. In addition to the previously mentioned changes, we are also including the following improvements:

For the AddNamedCommands2 method you will now be able to specify image objects that are System.Drawing.Bitmap or System.Drawing.Icon. (In addition to the IPicture support.) This should reduce some of the native to .NET conversion pains that many people have experienced. (Please note that CommandBarButton.Picture is strongly typed to IPicture, so no change was done to that property.)

A similar change for package authors – a new API, AddNamedCommands3, will be available that will also accept Bitmaps, Icons and IPictures.

I want to thank you again for being such a great advocate for the Visual Studio community, and for working with us to make sure that we make the right improvements.

Suzanne Hansen, Program Manager, Visual Studio Platform Shell Team
Posted by Microsoft on 8/24/2009 at 11:47 AM
Hello Carlos,

I wanted to let you know that the following improvements to Visual Studio 2010 were made based on your feedback:

1)    There will be support for loading a command's bitmap from the add-in module if there is no satellite DLL or if the satellite DLL doesn't contain the image.
2)    Commands.AddNamedCommand2 will now support an IPicture.

QA is currently testing these changes, and I cannot confirm at this time if these changes will appear in the Beta 2 release of VS 2010.

Suzanne Hansen, Program Manager, Visual Studio Platform Shell Team
Posted by Microsoft on 3/26/2009 at 10:24 AM
We are replacing the core shell UI layer with WPF for Visual Studio 2010 and have made a few changes to how resources are loaded. We'll check into getting some details on that for you. thanks