在我的应用程序中,我只有3个RichTextboxes,我只创建了一个ContextMenuStrip,因为我不喜欢重复同一个contextmenu的相同代码的想法,以及所有上下文菜单选项3次来使用它与其他两个例如,ContextMenuStrip的一个选项是“明文”,然后在过程中我需要指定RichTextbox对象名来清除文本:
Private Sub MenuItem_Clear_Text_Click(sender
controlTell me不能添加顶级控件,如何在PropertyGrid中显示ContextMenuStrip?provider.GetService(typeof(IWindowsFormsEditorService)) as ContextMenuStrip= null) MenuList = new ContextMenuStrip ();
我有一个ContextMenuStrip,其中一个项目有一个DropDownItems属性,该属性是动态添加的ToolStripMenuItem对象的集合。我找不到如何从这里确定“主机”ContextMenuStrip。它没有自己的Owner属性,并且Parent返回null。当我使用下面@Steve发布的代码的改编版本时:Dim menu As ContextMenuStrip= DirectCast((((drop