Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2005

Tip: Looking for answers? Try searching our database.

Addin: How to display separator below the button?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zeddy Iskandar - 15 May 2005 12:52 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.