c#winforms - 无法将自定义工具条按钮插入自定义工具条 [英] c# winforms - can't insert custom toolstripbutton into custom toolstrip

查看:113
本文介绍了c#winforms - 无法将自定义工具条按钮插入自定义工具条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好了。我需要以下问题的帮助。我已经创建了一个自定义工具条,并且我已经指定了一些允许我在设计时使用它的属性。工具条工作正常,但是当我创建自定义工具条带时,我无法将其添加到自定义工具条中,ToolStripItemsColleciontEditor关闭

以下是每个工具的示例代码

  //  自定义ToolStrip  
[ToolboxBitmap( typeof (ToolStrip))]
[Designer( typeof (System.Windows.Forms.Design.ControlDesigner))]
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
public partial class iAToolStrip:ToolStrip
{
public iAToolStrip()
{
的InitializeComponent();
}
}
// 自定义ToolStripButton
[Designer( typeof (ControlDesigner))]
[ToolboxBitmap( typeof (ToolStripButton))]
public partial class iAToolStripButton :ToolStripButton
{
public iAToolStripButton()
{
InitializeComponent();
}
}



任何帮助都是有价值的;

解决方案

< blockquote>谢谢kbrandwijk

 [Designer( typeof (ComponentDesigner))] 
[ToolboxBitmap ( typeof (ToolStripButton))]
public partial class iAToolStripButton:ToolStripButton


Hi, everybody again. I need help with the following problem. I've created a custom toolstrip and I've specified some attributes which allow me using it in design time. The toolstrip works fine but when I created the custom toolstripbutton I can't add it into the Custom ToolStrip, the ToolStripItemsColleciontEditor closes
Here's the sample code for each one

//Custom ToolStrip
[ToolboxBitmap(typeof(ToolStrip))]
[Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
public partial class iAToolStrip : ToolStrip
{
    public iAToolStrip()
    {
        InitializeComponent();
    }
}
//Custom ToolStripButton
[Designer(typeof(ControlDesigner))]
[ToolboxBitmap(typeof(ToolStripButton))]
public partial class iAToolStripButton : ToolStripButton
{
    public iAToolStripButton()
    {
        InitializeComponent();
    }
}


Any help would be valuable;

解决方案

Thank you kbrandwijk

[Designer(typeof(ComponentDesigner))]
[ToolboxBitmap(typeof(ToolStripButton))]
public partial class iAToolStripButton : ToolStripButton


这篇关于c#winforms - 无法将自定义工具条按钮插入自定义工具条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆