user5755765
user5755765

Reputation:

How to add DateTimePicker in ToolStrip?

I want to add a datetimepicker to a ToolStrip control to show today's date, so is there any way to add the datetimepicker in ToolStrip?

Example:

enter image description here

Thank you.

Upvotes: 3

Views: 7283

Answers (1)

Saeid Doroudi
Saeid Doroudi

Reputation: 1245

you can use this snippet :

var datePicker = new ToolStripControlHost(new DateTimePicker());
toolStrip1.Items.Add(datePicker);

Upvotes: 17

Related Questions