Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture Up, Down event DateTimePicker

Status
Not open for further replies.

ratjetoes

Programmer
May 24, 2002
30
NL
Hi,

I would like to raise an event from a custom DateTimePicker when an user clicks the Up or Down button (with the distiction of Up/Down).

I know normally the OnValueChanged event is raised.

In my example I have a custom format (dddd) which only shows the day. So the Up/Down buttons do not work (no value changed is fired).

I override the WndProc and if m.Message == WM_NOTIFY, i cast the LWPARAM to NMHDR. The problem however is that the code of NMHDR is 722, no matter if you press the Up button or the Down button. I would like to make a distinction between the Up and Down button so I know which action to take. Can anyone tell me how I can determine which button is clicked?

T.i.a.,
ratjetoes.
 
you could do something along the lines of:

retrieving the value of the control.

then on change, work out if the value is greater (up) or less (down) clicked.

Would this be a reasonable solution?

Regards,

Martin

Computing Design And Services:
 
hi martin,

tnx for your reply but i've already implemented a solution by intercepting windows message. turns out i have to convert to DTS_NUMDOWN.

tnx anyway,
ratjetoes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top