自定义控制与工具箱选项卡
我正在创建一个用户界面,并试图找出组织所有自定义控件的最佳方法。
我已经知道我可以执行以下操作:
1)如果我想通过“属性”窗口使设计时操作可见的属性,我使用以下...
[Browsable(true)]
[Description("Text for Display"), Category("Custom Properties")]
public string DisplayText
{
get
{
return textDisplay.DisplayText;
}
set
{
textDisplay.DisplayText = value;
}
}
2)如果我想从“工具箱”窗口隐藏该控件,我可以使用以下内容...
[ToolboxItem(false)]
public class TStrategyInput : FlickerControl
{
}
我想做的最后一件事是指定我的自定义控件在工具箱窗口中出现的选项卡(即类别) - 有人有任何建议吗?还有其他处理自定义控件的技巧吗?
提前致谢! 威廉
I am creating a user interface and I am trying to figure out the best way to organize all of my custom controls.
I already know that I can do the following:
1) If I want to have a property visible for design-time manipulation via the Properties window, I use the following...
[Browsable(true)]
[Description("Text for Display"), Category("Custom Properties")]
public string DisplayText
{
get
{
return textDisplay.DisplayText;
}
set
{
textDisplay.DisplayText = value;
}
}
2) If I want to hide the control from the Toolbox window, I can use the following...
[ToolboxItem(false)]
public class TStrategyInput : FlickerControl
{
}
The final thing that I am trying to do is to specify the Tab (i.e. category) that my custom control comes up under in the Toolbox window - does anyone have any suggestions? Are there any other tricks out there for handling custom controls?
Thanks in advance!
William
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请查看MSDN 演练:自动加载工具箱项目。
从上面:
查看上面演练提到的 Window Forms Toolbox Control:
Take a look at this MSDN Walkthrough:Autoloading Toolbox Items.
From above:
Looking at the Window Forms Toolbox Control that above walkthrough mentions: