Date picker user control - help needed

G

glerner

I would like to create a user control to mimic DateTimePicker. I don't
like DateTimePicker because it doesn't allow entering blank date
without having a check box. I like only the calendar dropdown portion
of DateTimePicker.

On my user control, I have a regular dropdown control. On DropDown
event I would like to create MonthCalendar control and display it.
Problem is, MonthCalendar doesn't fit inside the user control (user
control is size of dropdown control) and therefore it is invisible.

How can I create a control and allow it to display outside of the
custom control boundary? Or do I have to create a new window to do
this?

Thanks,
Glenn
 
N

Nicholas Paldino [.NET/C# MVP]

Glenn,

You will have to do something that other drop down controls do.
Basically, you will have to create a new window, and then have the control
embedded in that window. Of course, it would be your responsibility to
close the window and regain focus on the textbox when the calendar is gone.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

glerner said:
I would like to create a user control to mimic DateTimePicker. I don't
like DateTimePicker because it doesn't allow entering blank date
without having a check box. I like only the calendar dropdown portion
of DateTimePicker.

On my user control, I have a regular dropdown control. On DropDown
event I would like to create MonthCalendar control and display it.
Problem is, MonthCalendar doesn't fit inside the user control (user
control is size of dropdown control) and therefore it is invisible.

How can I create a control and allow it to display outside of the
custom control boundary? Or do I have to create a new window to do
this?

Thanks,
Glenn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top