C# toolstrip 上添加DateTimePicker Control控件

 

 

private void AddDTPtoToolstrip( n)
{
DateTimePicker dtp = DateTimePicker;
dtp.Width = 110;
dtp.Format = DateTimePickerFormat.Custom;
ToolStripControlHost host1 = ToolStripControlHost(dtp);
toolStrip1.Items.Insert(n, host1);
}

得到 DateTimePicker 值:
toolStrip1.Items[0].Text.; //得到index = 0Control控件值

posted @ 2020-01-01 07:41  清语堂  阅读(663)  评论(1编辑  收藏  举报