Handling mouse events on the page strip at bottom of window

P

Paul M

I am developing a WinForms app using Visio 2007 automation. I added (via
AddAdvise) a handler for mouse-down events (for example, so I can use my own
context menu on shapes). But I can't seem to handle mouse-down events on the
"page strip" at the bottom of the window. No matter what I do, a right-click
there always brings up the Insert Page (etc.) context menu, which I need to
disable. Any suggestions?

Thanks!
 
N

Nikolay Belyh

I am developing a WinForms app using Visio 2007 automation. I added (via
AddAdvise) a handler for mouse-down events (for example, so I can use my own
context menu on shapes). But I can't seem to handle mouse-down events on the
"page strip" at the bottom of the window. No matter what I do, a right-click
there always brings up the Insert Page (etc.) context menu, which I need to
disable. Any suggestions?

1. You can remove "insert page" menu by simply setting your own custom
menus for the document.
(with removed context menu at visUIObjSetCntx_PageTabs).
Here is an example that removes this menu from the active document:

Set custom_menus = Application.BuiltInMenus
custom_menus.MenuSets.ItemAtID(visUIObjSetCntx_PageTabs).Menus.Item(0).Delete
ActiveDocument.SetCustomMenus (custom_menus)
custom_menus.UpdateUI

2. To be able to capture mouse events on the tab strip you
might need to start "hooking and subclassing" (c) visio with windows
api.

Kind regards, Nikolay.
 

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