Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何隐藏或删除用户控件的现有智能标记? 脚本_C#_.net_Vb.net_Visual Studio_Windows Forms Designer - Fatal编程技术网

C# 如何隐藏或删除用户控件的现有智能标记? 脚本

C# 如何隐藏或删除用户控件的现有智能标记? 脚本,c#,.net,vb.net,visual-studio,windows-forms-designer,C#,.net,Vb.net,Visual Studio,Windows Forms Designer,我有一个从ComboBox继承的控件,它显示这个智能标记“编辑项目…”: 我想做的是从我的控件中删除该命令,以避免用户编辑该控件的Items集合 在源代码中隐藏Items属性的那一刻: C版本: VB.NET版本: Public Class DriveComboBox : Inherits ImageComboBox ' ImageComboBox inherits from ComboBox <Browsable(False)> <EditorBrowsa

我有一个从ComboBox继承的控件,它显示这个智能标记“编辑项目…”:

我想做的是从我的控件中删除该命令,以避免用户编辑该控件的Items集合

在源代码中隐藏Items属性的那一刻:

C版本:

VB.NET版本:

Public Class DriveComboBox : Inherits ImageComboBox ' ImageComboBox inherits from ComboBox

    <Browsable(False)>
    <EditorBrowsable(EditorBrowsableState.Never)>
    <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)>
    <MergableProperty(False)>
    <Bindable(False)>
    Public Shadows ReadOnly Property Items As ImageComboBoxItemCollection
        Get
            Return MyBase.Items
        End Get
    End Property

End Class
公共类DriveComboBox:继承ImageComboBox'ImageComboBox从ComboBox继承
作为ImageComboBoxItemCollection的公共阴影只读属性项
得到
返回MyBase.Items
结束
端属性
末级
…我知道它可以通过键入成员名称的方式访问,但至少对普通用户是隐藏的

问题:
如何隐藏/删除控件的“编辑项…”智能Taf

另外,如果有人能记得我MSDN文章的url,该文章解释了如何将新命令/任务添加到菜单中


编辑:没有必要,@Proputoix已经回答了我的可选请求。

@Proputoix太棒了!这个名字叫“智能标签”。谢谢你记得我。有没有办法为继承的组合框隐藏现有的智能标记?也许我需要通过反射来完成它?…用
来装饰类会容易得多,以完全消除智能标记。否则,您将需要一个自定义设计器类和一个自定义DesignerActionList。@tnt这就像魔术一样。它解决了这个问题。谢谢你!
Public Class DriveComboBox : Inherits ImageComboBox ' ImageComboBox inherits from ComboBox

    <Browsable(False)>
    <EditorBrowsable(EditorBrowsableState.Never)>
    <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)>
    <MergableProperty(False)>
    <Bindable(False)>
    Public Shadows ReadOnly Property Items As ImageComboBoxItemCollection
        Get
            Return MyBase.Items
        End Get
    End Property

End Class