rever
rever

Reputation: 197

Windows Form DateTimePicker always open

I have one DateTimePicker on WindowsForm that should stay open for all life of the form. How I can do that WITHOUT use the command by line to open it everytime CloseUp. I need something like a properties to prevent the closing.

Upvotes: 3

Views: 2732

Answers (2)

rever
rever

Reputation: 197

Thanks for the tip of use MonthCalendar instead of DateTimePicker, it works for me. To be a little clearer to further readers:

  1. replace DateTimePicker with MonthCalendar
  2. set the property monthCalendar.MaxSelectionCount to 1
  3. use monthCalendar.SelectionRange.Start instead of dtp.Value to get the selected date

Upvotes: 4

Bucketcode
Bucketcode

Reputation: 481

Using Calendar instead of DateTimePicker

Upvotes: 4

Related Questions