Removing standard menus / menu items from 2005 IDE via Add-In

Removing standard menus / menu items from 2005 IDE via Add-In

Post by mungle » Sat, 21 Oct 2006 09:16:54


I've created the skeleton framework for a Visual Studio 2005 add-in
(C#) and I was wondering if there is a way to remove any of the
standard built menus or menu items? I see lot's of tutorials on how
to add your own menus or custom menu items, but nothing talks about
removing any of the standard items.

For example how can I get rid of the "Community" menu or the
"Tools > Framework Browser" menu item when the "OnConnection()"
method is called in the Add-in?

Thanks.

-M
 
 
 

Removing standard menus / menu items from 2005 IDE via Add-In

Post by mungle » Sun, 22 Oct 2006 05:55:16

Figured it out.


Microsoft.VisualStudio.CommandBars.CommandBar menuBarCommandBar =
((Microsoft.VisualStudio.CommandBars.CommandBars)_applicationObject.CommandBars)["MenuBar"];


//Find the Tools command bar on the MenuBar command bar:
CommandBarControl toolsControl = menuBarCommandBar.Controls["Tools"];
CommandBarPopup toolsPopup = (CommandBarPopup)toolsControl;

// Hide the entire tools menu
toolsPopup.Visible = false;

 
 
 

Removing standard menus / menu items from 2005 IDE via Add-In

Post by Carlos J. » Tue, 24 Oct 2006 20:56:40

Be sure that you know why you are doing that, hopefully an add-in for your
own use or your own organization and not for the general public, because
that would be an unacceptable behavior for an add-in.

Just in case...

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.yqcomputer.com/


< XXXX@XXXXX.COM > escribien el mensaje
>> Figured it out. >> >> >> Microsoft.VisualStudio.CommandBars.CommandBar menuBarCommandBar = >> ((Microsoft.VisualStudio.CommandBars.CommandBars)_applicationObject.CommandBars)["MenuBar"]; >> >> >> //Find the Tools command bar on the MenuBar command bar: >> CommandBarControl toolsControl = menuBarCommandBar.Controls["Tools"]; >> CommandBarPopup toolsPopup = (CommandBarPopup)toolsControl; >> >> // Hide the entire tools menu >> toolsPopup.Visible = false; >> >> >> >>
>>> I've created the skeleton framework for a Visual Studio 2005 add-in >>> (C#) and I was wondering if there is a way to remove any of the >>> standard built menus or menu items? I see lot's of tutorials on how >>> to add your own menus or custom menu items, but nothing talks about >>> removing any of the standard items. >>> >>> For example how can I get rid of the "Community" menu or the >>> "Tools>> Framework Browser" menu item when the "OnConnection()" >>> method is called in the Add-in? >>> >>> Thanks. >>> >>> -M >>