Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Windows 窗体中如果我制作了一个继承自的自定义控件,ToolStripMenuItem有没有办法从设计器中添加它CustomToolStripMenuItem,MenuStrip还是我必须通过代码来完成?(因为ToolStripMenuItem它们是在没有从工具箱中拖动的情况下添加的)
ToolStripMenuItem
CustomToolStripMenuItem
MenuStrip
尝试用这个属性装饰它:
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.MenuStrip)] public class MyToolStrip : ToolStripMenuItem { }