I'm trying to add a new menu bar to my Add-In instead of adding to an
existing menu. I've got this working fine, but I can't figure out how to
change a few properties on the CommandBar...
Specifically I need to set the BeginGroup option. How do I get at the
underlying CommandBarControl to set .BeginGroup?
I tried this:
CommandBar commandBar = applicationObject.Commands.AddCommandBar("West Wind
Html Help
Builder",vsCommandBarType.vsCommandBarTypeMenu,commandBar,InsertionIndex) as
CommandBar;
Command cbMenu = applicationObject.Commands.Item("West Wind Html Help
Builder",-1);
CommandBarControl cbMenu2 = cbMenu as CommandBarControl;
and got a Command object, but not the CommandBarControl. Any ideas?
Also it would be nice to set an icon for this item, but that's not likely to
happen?
+++ Rick ---

Signature
Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
Rick Strahl [MVP] - 02 Aug 2004 11:49 GMT
Never mind. I can just use the InsertionIndex to actually retrieve the
CommandBarControl from the parent menu. Still seems odd that you can't more
easily reference this menu item.
CommandBar commandBarHelp = (CommandBar)commandBars["Help"];
int InsertionIndex = commandBarHelp.Controls.Count - 2;
CommandBar commandBar = applicationObject.Commands.AddCommandBar("West Wind
Html Help Builder",
vsCommandBarType.vsCommandBarTypeMenu,commandBarHelp,InsertionIndex) as
CommandBar;
CommandBarControl cbMenu = commandBarHelp.Controls[InsertionIndex];
cbMenu.BeginGroup = true;
InsertionIndex = 1; // Insert Items at the top
+++ Rick ---

Signature
Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
> I'm trying to add a new menu bar to my Add-In instead of adding to an
> existing menu. I've got this working fine, but I can't figure out how to
[quoted text clipped - 20 lines]
>
> +++ Rick ---