c#winforms - 无法将自定义工具条按钮插入自定义工具条 [英] c# winforms - can't insert custom toolstripbutton into custom toolstrip
本文介绍了c#winforms - 无法将自定义工具条按钮插入自定义工具条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是每个工具的示例代码
// 自定义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屋!
查看全文