DateTimePicker and DropDown event / button

A

Arturo

Dear all!:

I have a problem with the DateTimePicker that has driven me mad!!!
I am trying to render a flat datetimepicker, but everything goes wrong
here.

When you press the button, apparently this is what is happening:

1. Press the button.

a)The control creates the new MonthCalendar
b)The control fires the DropDown event.
c)The MonthCalendar is displayed
d)THE DATETIMEPICKER REDRAWS THE BUTTON!!!

As you can see, after this, the old style button is redrawn. At
this point, nothing else happens!!!

I have tried every workaround, and I think is just impossible to do
it. Please don't reply if you haven't managed to do it for real (the
ones that have tried/achieved it might know what I'm talking about).

The OnPaint doesn't work (do nothing on the OnPaint and click on the
area of the invisible button and you will see it appear!!!! as
magic!!! --Remember SetStyle(UserPaint).

WndProc: No luck. Even repainting in EVERY MESSAGE I GET!!!


If anyone at microsoft knows what is happening inside
the DateTimePicker control, please let the community know how it
really works. (It seems to me that this is a "PATCH" in the
framework, but maybe thousands of people are wasting their time
nothing!!!)

I think the workaround is to get a handle to the monthcalendar in the
DropDown event, but I cannot find the ControlID to get it. (the
parent is the Form, not the DateTimePicker)

Thanks everybody! Let's crack this!
 
C

Claes Bergefall

I think the workaround is to get a handle to the monthcalendar in the
DropDown event, but I cannot find the ControlID to get it. (the
parent is the Form, not the DateTimePicker)

The handle to the monthcalendar can be obtained by sending
a DTM_GETMONTHCAL message to the datatimepicker.


/claes
 
A

Arturo

The handle to the monthcalendar can be obtained by sending
a DTM_GETMONTHCAL message to the datatimepicker.


/claes

Thanks /claes. I managed to get the MonthCalendar and guess what: No
luck. Thank you anyway. I have to stop trying because I have other
things to do, but I will come back to it. If anybody at Microsoft
knows how it works, I would be very grateful to know about it.

Thanks!

Arturo
 

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