Ah, you're using the Vis control!
Make your own menus on the form. It's easier than trying to show the Visio
menus (as far as I know) I've never used the built-in Visio menus when using
the control (other than the right-click menu)
More info in this article, with an excerpt below:
http://msdn.microsoft.com/library/d.../odc_vsProgrammingWithVisioActiveXControl.asp
--
Hope this helps,
Chris Roth
Visio MVP
--------------------------------------------------------
Integrating Menus and Toolbars
The best practice when building an application using the Visio drawing
control is to implement a custom UI. If you want to display Visio menus and
toolbars in your container application, set the drawing control's
NegotatiateToolbars and NegotiateMenus properties. The following C# code
enables both menu and toolbar merging:
drawingControl.NegotiateMenus = True;
drawingControl.NegotiateToolbars = True;
The best practice is to set both of these properties to the same value. The
control will not support independent negotiation of toolbars and menus.
Menu and Toolbar Integration for Non-OLE Menu Merging Hosts
If your container does not support OLE menu merging (for example, a Windows
Form), you can use the IOleCommandTarget interface to run Visio commands.
You can implement your own menu item or toolbar button as demonstrated by
the following C# example:
using System.Runtime.InteropServices;
using System;
namespace OleCommandTarget
{
[StructLayout(LayoutKind.Sequential)]
public struct OLECMDTEXT
{
public UInt32 cmdtextf;
public UInt32 cwActual;
public UInt32 cwBuf;
public char rgwz;
}
[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public UInt32 cmdID;
public UInt64 cmdf;
}
[ComImport(), Guid("B722BCCB-4E68-101B-A2BC-00AA00404770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleCommandTarget
{
[PreserveSig()]
int QueryStatus( [In, MarshalAs(UnmanagedType.Struct)] ref Guid
pguidCmdGroup, [MarshalAs(UnmanagedType.U4)] int cCmds,
[In, Out] IntPtr prgCmds, [In, Out] IntPtr pCmdText);
[PreserveSig()]
int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdExecOpt,
object[] pvaIn, [In, Out, MarshalAs(UnmanagedType.LPArray)]
object[] pvaOut);
}
}
After you have created your menu item, use your IOleCommandTarget interface
to apply the appropriate Visio user interface command for that target. The
following example enables the Connector tool when a menu item is clicked:
using OleCommandTarget;
private void menuItem_Click(object sender, System.EventArgs eventData)
{
SendCommand();
}
private void SendCommand()
{
const UInt32 VISCMD_DRCONNECTORTOOL =
(UInt32)Visio.VisUICmds.visCmdDRConnectorTool;
IOleCommandTarget commandTarget =
(IOleCommandTarget)axDrawingControl1.GetOcx();
try
{
Guid CLSID_Application = new Guid("{0x00021A20, 0x0000, 0x0000,
{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}");
commandTarget.Exec(ref CLSID_Application, VISCMD_DRCONNECTORTOOL,
0, null, null);
}
catch(System.Runtime.InteropServices.COMException ex)
{
MessageBox.Show(ex.ToString());
}
}
....