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.
(e-mail address removed)
thanks
dinesh
:
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);
:
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
:
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
:
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
:
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
:
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
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