Hi all,
I've created a commandBar that appears when a user right-click the Class item in the Class View Explorer.
However, I want myButton to appear on top of "Go To Definition" button, followed by a separator.
visually:
myButton
----------------
Go To Definition
Go To Declaration
etc...
Is this possible?
I tried setting BeginGroup to true, but then BeginGroup only puts the separator above myButton, not below it.
Thus my code below won't work:
Command cmd = commands.AddNamedCommand(...,"myButton",...)
CommandBar cmdBar = (CommandBar)commandBars["Class View Item"]
CommandBarCtrl cmdBarCtl = cmd.AddControl(cmdBar, 1)
cmdBarCtl.BeginGroup = true
I know if I set myButton to position 2, there'll be a separator on top of myButton. But I want myButton to appear on top of "Go To Definition" followed by a separator. So I have 2 options:
1. Is there a hidden EndGroup property I can use?
2. Can I get a ref to "Go To Definition" commandBar instead, and set its BeginGroup property to true?
Regards,
Zeddy Iskandar
Carlos J. Quintero [.NET MVP] - 18 May 2005 14:08 GMT
> 1. Is there a hidden EndGroup property I can use?
No, you can only begin groups.
> 2. Can I get a ref to "Go To Definition" commandBar instead, and set its
> BeginGroup property to true?
Yes, you can get the CommandBarControl "Go To Definition" from the Controls
collection (searching by caption or ID, not sure), cast to CommandBarButton
and set the BeginGroup property. I have not tested, but it should work.

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com