delphi - Set date on TDateTimePicker On drop down -
i have datetimepicker on delphi 6 form default date of 30/12/1899. want users able click on or open dropdown calendar , select current date. using onclick procedure with:
datetimepicker.date := date
sets date in editable part date when users click on or calendar dropdown button not force calendar automatically select today's date. result same if use code in datetimepicker's ondropdown procedure.
do need use in post manipulate calendar? or there simple property i've missed?
thanks matt
you can update month calendar window directly via monthcal_setcursel
.
(i leave "default" logic you):
uses commctrl; type tdatetimepickeraccess = class(tdatetimepicker); procedure tform1.datetimepicker1dropdown(sender: tobject); var st: tsystemtime; calendarhandle: hwnd; begin datetimepicker1.date := date; datetimetosystemtime(date, st); calendarhandle := tdatetimepickeraccess(datetimepicker1).getcalendarhandle; monthcal_setcursel(calendarhandle, st); end;
personally set default date whatever default date (date
).
Comments
Post a Comment