Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2387
How do I have one tool on different toolbars?
posted

I am working on a dockmanager style UI that follows the way Visual Studio 2008 implements the UI:

I need to create a tool similar to how VS2008 has the "Add New Data Source" which is in both the main menu and in a toolbar that is specific to the dock manager Data Source DockAreaPanel.

How would I go about doing this in the UI designer?

Sam

Parents
No Data
Reply
  • 3565
    Verified Answer
    posted

    I see what you are trying to do. The problem is that if you have two different toolbar manager controls you are unable to share the same button object between the main toolbar and the toolbar in the docked area. Unfortunately there is no Dock Within Container property on the toolbar object so you end up having to create two different toolbar manager objects which kind of stinks.

    I'm assuming you would like to manage your toolbars at design time instead of trying to do it at run time. What I normally do is when ever I have a toolbar I only use the tool click event to call the procedure that will actually handle the event. If you did the same thing in this scenario you wouldn't have to duplicate action code. In fact I was thinking that you could have the same tool click handler procedure handle both your docked toolbar manager control and the main toolbar manager control events. So long as the tool keys are the same for the buttons that are meant to be the same in each toolbar manager the same code would run whether they clicked the main toolbar button or the docked toolbar button. Finally if you used to same image list for each toolbar you could easily show the same button icons too without much hassle.

Children