Visio UI & VDC

T

Tony Gratton

Hi,

I am developing a Visio application in C#2005 using the VDC. I want to
disable Visio's UI so that I can present my own. My main focus is to disable
the context menu displayed when right clicking on the drawing surface in the
VDC.

I have successfully managed to do so by indentifying the 'Drawing Object
Selected' shortcut menu set (visUIObjSetCntx_DrawObjSel), then cycling
through the menu items and setting the visible and enabled properties to
'false'.

My problem is with the hyperlinks in the shortcut menu which refuse to
disappear. Whatever I do, they appear when right clicking. Logic tells me
that they are being recreated dynamically when the shape select is made in
the VDC.

Can anyone please suggest a strategy for disabling these dynamic hyperlink
shortcut entries?

By the way, I have already tried cyclng through every menu with my disabling
strategy, but to no effect and have already tried various combinations using
the Delete method with the different menu objects and this proved to be less
effective than my current strategy. I am working in both 2003 and 2007
versions.

Thanks in advance for your help.
Tony
 
J

JuneTheSecond

Shortcut menus can be made with shapesheet as wel as with UIObject.
My assumption is that hyperlink is made by shapesheet.
So, the value of visible cells of each shape having hyperlinks might be
set to False.
 
P

Paul Herber

Hi,

I am developing a Visio application in C#2005 using the VDC. I want to
disable Visio's UI so that I can present my own. My main focus is to disable
the context menu displayed when right clicking on the drawing surface in the
VDC.

I have successfully managed to do so by indentifying the 'Drawing Object
Selected' shortcut menu set (visUIObjSetCntx_DrawObjSel), then cycling
through the menu items and setting the visible and enabled properties to
'false'.

My problem is with the hyperlinks in the shortcut menu which refuse to
disappear. Whatever I do, they appear when right clicking. Logic tells me
that they are being recreated dynamically when the shape select is made in
the VDC.

Can anyone please suggest a strategy for disabling these dynamic hyperlink
shortcut entries?

By the way, I have already tried cyclng through every menu with my disabling
strategy, but to no effect and have already tried various combinations using
the Delete method with the different menu objects and this proved to be less
effective than my current strategy. I am working in both 2003 and 2007
versions.

Thanks in advance for your help.
Tony

As June The Second has mentioned, each item in the hyperlinks section
in the shapesheet has an "Invisible" cell that you can set to true.
 
D

David Parker

Hi Tony,

I just tried setting Invisible=TRUE, and this removed the Hyperlinks from
the right-mouse menu, even in the Drawing Control. What am I not
understanding? How are the Hyperlinks created in the first place?
 
T

Tony Gratton

Hi David,

You are correct. Setting Invisible=TRUE in the shapesheet eliminates the
hyperlinks from the right-mouse menu in the Drawing Control.

You know how when the hyperlinks were present in the right-mouse menu, an
image (icon composed of globe & chain) also shows to the left of the
hyperlink description in the menu? After setting Invisible=TRUE in the
shapesheet the hyperlink disappears, the hyperlink description disappears,
the hyperlink image disappears but the square container which contained the
image still appears at the cursor location.

For my new shortcut menu, I am using a ContextMenuStrip attached to the
drawing control. Currently, this menu also shows an empty box for the menu
item image as I have not assigned any images to my shortcuts on this menu.
Could it be that there is some interaction between the settings of this
ContextMenuStrip and the Visio UI right-mouse menu which is causing the box
to appear even though the rest of the Visio UI right-mouse menu has been
disabled? Any light you might throw onto this would be very welcome.

By the way, the reason I went for the route of creating my own context menu
is that I could not find a way to detect when a particular right-mouse
Drawing Control menu item had been selected. If you know of a way of
detecting this I would be very interested to hear of it for future use.

Thanks & kind regards,
Tony
 
T

Tosh

I'm using the VDC from Visio 2007, and use the MouseUpEvent from the control.

private void drawingControl_MouseUpEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseUpEvent e)
{
e.cancelDefault = true; // suppresses Visio's context menu
// display your own context menu here
}
 

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