将自定义菜单项添加到ToolStripMenuItem的集合列表中

时间:2014-09-05 12:52:23

标签: vb.net toolstripmenu toolstripitem

我正在构建自己的ToolStripMenuItem,我希望它显示在要添加到Menu的DropDownItems集合的选项列表中。我该怎么做?

这是我到目前为止所拥有的。

imports System.ComponentModel

''' <summary>
''' A list of check box items that remember which item is currently checked
''' </summary>
public class ToolStripCheckItemList : inherits ToolStripMenuItem
    private itemsList as List(of Object)

    event checkedItemChanged(sender as Object, e as EventArgs)

    <Category("Items"), _
        Description("The list of items contained in the check list.")>
    public property items() as List(of Object)
    set

    End Set
    Get
        return itemsList
    End Get
    End Property
end class

1 个答案:

答案 0 :(得分:0)

这是我需要的属性。我把它放在我的班级名字上方。

<ToolStripItemDesignerAvailabilityAttribute(ToolStripItemDesignerAvailability.MenuStrip)>