ToolStrip动态添加自定义控件
来源:互联网 发布:淘宝的膳魔师是真的吗 编辑:程序博客网 时间:2024/06/02 08:11
ToolStripControlHost dateTimePickerHost;
private void InitializeDateTimePickerHost()
{
// Create a new ToolStripControlHost, passing in a control.
dateTimePickerHost = new ToolStripControlHost(new DateTimePicker());
// Set the font on the ToolStripControlHost, this will affect the hosted control.
dateTimePickerHost.Font = new Font("Arial", 7.0F, FontStyle.Italic);
// Set the Width property, this will also affect the hosted control.
dateTimePickerHost.Width = 100;
dateTimePickerHost.DisplayStyle = ToolStripItemDisplayStyle.Text;
// Setting the Text property requires a string that converts to a
// DateTime type since that is what the hosted control requires.
dateTimePickerHost.Text = "12/23/2005";
// Cast the Control property back to the original type to set a
// type-specific property.
((DateTimePicker)dateTimePickerHost.Control).Format = DateTimePickerFormat.Short;
// Add the control host to the ToolStrip.
toolStrip1.Items.Add(dateTimePickerHost);
}
列:
ToolStripControlHost toolStripControlHost = new ToolStripControlHost(new Button.DJGridSetButton());
//Button.DJGridSetButton djBtn = new ZF_ERP.Button.DJGridSetButton();
((Button.DJGridSetButton)toolStripControlHost.Control).GridID = m_FormID;
((Button.DJGridSetButton)toolStripControlHost.Control).FormID = m_FormID;
((Button.DJGridSetButton)toolStripControlHost.Control).Text = "单据表格设置";
toolStrip.Items.Add(toolStripControlHost);
- ToolStrip动态添加自定义控件
- VB.NET2005 动态添加 ToolStrip 控件
- 向ToolStrip、MenuStrip、StatusStrip中添加自定义控件
- 关于Toolstrip中添加自定义控件DateTimePicker使用说明
- ToolStrip添加任意控件实现
- 在ToolStrip控件上添加控件
- C# toolstrip 上添加 DateTimePicker 控件
- WinForm ToolStrip添加DateTimePicker日历控件
- VB 2005 Toolstrip动态添加菜单
- C# ToolStrip 控件的动态生成
- Winform下ToolStrip承载自定义控件或 Windows 窗体控件。
- ASP.NET 动态添加自定义控件
- C#中的toolStrip控件
- 工具栏控件ToolStrip
- C#在控件上有序地动态添加自定义控件
- 关于动态添加的自定义控件的问题
- Android中如何在“自定义布局”中“动态”添加控件
- 自定义组合控件以及UI的动态添加
- Web Beans Public Review Draft released
- GFS与RHCS安装记录
- 在存储过程中创建临时表
- 关于validate验证用户名是否存在的简易理解
- 计算两个日期的时间间隔
- ToolStrip动态添加自定义控件
- “我应为王”,比尔盖茨名言--author :邵京国
- 自动分配实例,不像Spring一样需要在配置文件中手工配置类
- DC?设备上下文?怎么翻译的。。。终于弄懂了。
- 全排列
- charindex、PATINDEX
- 颇有启发的一个故事!
- 开发基于 Dojo 的博客阅读器--邵京国
- linux下wine安装成功后运行不了 err:process:init_windows_dirs directory L"C://windows