using CommandBars

P

Paul

Hi,
I've trying to display some of the toolbars and menus that come with visio
2007 inside my application without any luck. Could someone please give me a
hand here?

I'm setting the following already:
axDrawingControl1.NegotiateMenus = true;
axDrawingControl1.NegotiateToolbars = true;

I've come across a sample online on how this can be accomplished, but it
doesn't appear to be the correct syntax:

axDrawingControl1.Window.Application.CommandBars("Layout &
Routing").Visible = true;

CommandBars however appears to be a read-only property and not a method.

It'd be great if someone could shed some light here?

Thank you,
Paul
 
P

Paul

Just a small update - I was able to access the Visible property by using the
code below, however the toolbars still do not show up in my application -
newToolbarSet.Toolbars[1].Caption return "Formatting" so I'm assuming I have
the correct syntax. The only toolbar that is being displayed is the Drawing
toolbar which got displayed as soon as I set NegotiateToolbars and Menus to
true.

UIObject VisioUIO;
ToolbarSet newToolbarSet;

VisioUIO = axDrawingControl1.Window.Application.CustomToolbars;

newToolbarSet =
VisioUIO.ToolbarSets.get_ItemAtID((int)VisUIObjSets.visUIObjSetDrawing);

newToolbarSet.Toolbars[1].Visible = true;
newToolbarSet.Toolbars[2].Visible = true;
newToolbarSet.Toolbars[3].Visible = true;

axDrawingControl1.Window.Application.SetCustomToolbars(VisioUIO);
VisioUIO.UpdateUI();

What am I doing wrong? :(

Thanks,
Paul
 
P

Paul

For anyone who cares I was able to display the toolbars finally by adding

newToolbarSet.Toolbars[1].Position = 4;

before setting the Visible property to true;


However, the Standard and Formatting toolbars are the only ones that are
displayed unless I right click on one of those two and check additional ones.

Is there any way to Dock them onto my application? Floating toolbars appear
a little out of place in this case. If that's not possible, is there any way
to import the functionality of a Visio Toolbar into a ToolStrip object?

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top