Nickolay Kondratyev
Nickolay Kondratyev

Reputation: 5221

WinForms: Adding custom ToolStripMenuItem to MenuStrip in designer

In Windows Forms If I make a custom control that inherits from ToolStripMenuItem is there a way to add this CustomToolStripMenuItem to MenuStrip from designer or do I have to do it through code? (since the ToolStripMenuItem are added without dragging them from the toolbox)

Upvotes: 2

Views: 2840

Answers (1)

LarsTech
LarsTech

Reputation: 81675

Try decorating it with this attribute:

[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.MenuStrip)]
public class MyToolStrip : ToolStripMenuItem {

}

Upvotes: 2

Related Questions