Page tree
Skip to end of metadata
Go to start of metadata

使用C1CommandHolder类的GetC1ContextMenu方法来确定一个控件被附加了哪个C1ContextMenu。 GetC1ContextMenu方法返回附加在特定控件上的上下文菜单。
使用如下代码来获取附加在C1TextBox1上的C1ContextMenu控件的名字:
Visual Basic

Visual Basic

'retrieves the contextmenu attached to the C1TextBox control Dim contextMenu As C1.Win.C1Command.C1ContextMenu contextMenu = C1CommandHolder1.GetC1ContextMenu(C1TextBox1)
MessageBox.Show(ContextMenu.Name)

C#

C#

//retrieves the contextmenu attached to the C1TextBox control C1.Win.C1Command.C1ContextMenu contextMenu;
contextMenu = C1CommandHolder1.GetC1ContextMenu(C1TextBox1);
MessageBox.Show(ContextMenu.Name);

  • No labels