简体   繁体   English

如何在自定义UserControl中编辑ContextMenuStrip?

[英]How to edit ContextMenuStrip inside of custom UserControl?

As you know, when you add a ContextMenuStrip to form it will place an icon of it on the bottom of form designer. 如您所知,当您添加一个ContextMenuStrip到窗体时,它将在窗体设计器的底部放置一个图标。 After clicking that icon visual "menu designer" will appear. 单击该图标后,将出现可视的“菜单设计器”。

Now assume that I have developed a custom user control which have such (single) ContextMenuStrip inside it. 现在假定我已经开发了一个自定义用户控件,该控件内部具有此类(单个)ContextMenuStrip。 What Iam looking for is a way to show the same "menu designer" for this ContextMenuStrip inside of my custom UserControl after clicking it (my control). Iam寻找的是一种在单击自定义UserControl(我的控件)后在此ContextMenuStrip中显示相同的“菜单设计器”的方法。

Any ideas how to do that ?! 任何想法如何做到这一点? Coz me and google have run out of them ... :/ Thx in advance 因为我和谷歌已经用光了...:/提前

The designer does not support this. 设计器不支持此功能。 I won't say it's impossible but ot will be a lot of work. 我不会说这是不可能的,但是将会有很多工作要做。

Maybe you're better of filling the contextStrip from code (in the hosting Form). 也许您最好从代码(在托管表单中)填充contextStrip。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM