Re: Working with Visio 2003 Page & Shape context (popup) menus in

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



hi

can u provide me full code , still i am not able to display the menu,

my problem is i have to add a menuitem on the menu which is displayed when
the user right clicks on the shape which he has drawn on the visio sheets.

i would be highly thankful to u , if u could provide me the whole code or
mail me.
sachdevadinesh@xxxxxxxxx


thanks

dinesh



"MikeBTP" wrote:

You will need to add a ContextMenuStrip to the form and in the drawing's
MouseUp event you add the code to open this menu something like:
Control control = (Control)sender;
Point clientPos = control.PointToClient(Cursor.Position);
m_contextMenuStrip.Show(control, clientPos);


"dinesh" wrote:

Hi Mike

thanks for the reply , i was able to disable the right click menu with your
code,
but i was unable to add the contextmenustrip to the visio can u help me out
with this, if possible a piece of code.

actually i want to add an item to that menu or we can create a new menu in
place.

thanks

dinesh



"MikeBTP" wrote:

Hi Dinesh,

I was not able to work with the Built-in Menus of Visio 2003 but did use the
CommandBars object from office (COM reference to MS Office 11.0 object
lib---mso.dll). Unfortunately, I was not able to manipulate the popup context
menu as I would have liked to so I disabled it using code below and added a
ContextMenuStrip in C#.

office.CommandBars cBars;
cBars = office.CommandBars)this.m_drawing.Document.Application.CommandBars;
cBars["Drawing Object Selected"].Enabled = false;

This still left me with an issue of what has the focus (a shape or the
sheet) when a user right-clicks on an object to simultaneously select it and
popup the context menu. None of the Visio events I tried was able to give me
this info.

Regards,

Mike


"dinesh" wrote:

Hi Mike and John
even i Have the same problem as mike has but was not able to figure out it,
can u guys help me out with this, i would be highly appreciate your help.
if u could let me know the way to proceed and if possible a piece of code.

thanks

dinesh




"MikeBTP" wrote:

Hi John,

Thank you so much for the info. This should help a lot. If I have any other
questions after digesting this I'll ask.

Any info you give me is always useful even if I'm already aware of
something. It might, as in the case of the Actions in shapesheet, give me a
reason to look further into something that I may have overlooked.

Thanks again,
Mike

"John Goldsmith" wrote:

Hello Mike,

You can delete menus/items as you wish from the CommandBars collection or
the UIObject (CommandBars is the prefered method these days).

Take a look at this link, which describes how to carry out the operation:

http://msdn2.microsoft.com/en-us/library/aa201791(office.10).aspx

Bear in mind also (apologies if I'm not telling you something new) that
shapes can also contain right-click menu items within the Actions shapesheet
section.

Best regards

John


John Goldsmith
www.visualSignals.co.uk

"MikeBTP" <MikeBTP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B1CEC2E7-3DA3-48D6-89BC-89C914361473@xxxxxxxxxxxxxxxx
We are using Visio 2003 as a drawing control in a C# project and are able
to
manipulate or use various Visio built-in menus but cannot change the
context
(right-click popup) menu for a drawing page or shape. How do we access
this
menu and remove some of its menu items and add our own menu items. Not
able
to determine what menu it is and when we can access it (before
displaying).
Any VBA sample code would also be helpful.

Thanks for any help,
Mike



.



Relevant Pages

  • RE: Working with Visio 2003 Page & Shape context (popup) menus in
    ... "dinesh" wrote: ... can u provide me full code, still i am not able to display the menu, ... There are examples of how you might create it in the visio sdk. ... manipulate or use various Visio built-in menus but cannot change the context ...
    (microsoft.public.visio.general)
  • RE: Table of data on ERD
    ... You have designed your great ER diagram with Visio ... Open or create an Excel document and create two rows of data, ... You can format the cell data as ... will be displayed as to how you want to display the data next to your Entity. ...
    (microsoft.public.visio.general)
  • Re: Working with Visio 2003 Page & Shape context (popup) menus in
    ... "MikeBTP" wrote: ... that form and add a ContextMenuStrip to the form that's all the code you need. ... If this is not how you're using Visio then what you need will probably be ... "dinesh" wrote: ...
    (microsoft.public.visio.developer.vba)
  • RE: Table of data on ERD
    ... You have designed your great ER diagram with Visio ... Open or create an Excel document and create two rows of data, ... will be displayed as to how you want to display the data next to your Entity. ... Use Microsoft's powerful connection features as you need. ...
    (microsoft.public.visio.general)
  • Re: Table of data on ERD
    ... Note that this will only work in Visio 2007 Professional. ... data from an Excel spreadsheet. ... will be displayed as to how you want to display the data next to your ... Use Microsoft's powerful connection features as you need. ...
    (microsoft.public.visio.general)