Uses commctrl;
VaR oldwindowproc: twndmethod;
Procedure tform1.mywindowproc (var msg: tmessage );
Begin
If msg. MSG = cn_notify then
Begin
Case twmnotify (MSG). nmhdr. Code
Mcn_getdaystate: memo1.lines. Add ('mcn _ getdaystate'); // click the page
Mcn_select, mcn_selchange: memo1.lines. Add ('mcn _ select, mcn_selchang'); // select a date
End;
End;
Oldwindowproc (MSG );
End;
Procedure tform1.formcreate (Sender: tobject );
Begin
Oldwindowproc: = monthcalendar1.windowproc;
Monthcalendar1.windowproc: = mywindowproc;
End;
549 of the questions. After reading the answer, I checked the VCL source code. It should be okay! However, clicking "click" and "Press" on the page will also trigger messages in the selected date. On the contrary, no!
At the same time, you can see one:
Released a solution for tdatetimepicker to modify the date and time at the same time
Type
Tcdatetimepicker = Class (tdatetimepicker)
Private
Procedure cnnotify (VAR message: twmnotify); message cn_notify;
End;
Function isblankpolicime (const ST: tsystemtime): Boolean;
Type
Tfast = array [0 .. 3] of DWORD;
Begin
Result: = (tfast (ST) [0] Or tfast (ST) [1] Or tfast (ST) [2] Or tfast (ST) [3]) = 0;
End;
Procedure tcdatetimepicker. cnnotify (VAR message: twmnotify );
Begin
With message, nmhdr ^ do
Begin
Result: = 0;
If (code = dtn_datetimechange) and
(Pnmdatetimechange (nmhdr) ^. dwflags = gdt_valid) and (not droppeddown) and
(Not (showcheckbox and isblankpolicime (pnmdatetimechange (nmhdr) ^. St) then
Datetime: = systemtimetodatetime (pnmdatetimechange (nmhdr) ^. St );
End;
Inherited;
End;
Procedure tform1.button1click (Sender: tobject );
Begin
With tcdatetimepicker. Create (Self) Do
Begin
Left: = 100;
Top: = 100;
Parent: = self;
Format: = 'yyyy-mm-dd hh: mm: ss ';
Visible: = true;
End;
End;
You can directly change the value based on the upper and lower limit! However, to change it to the drop-down panel, you can also select a time option. It may be a bit easier!
BTW: kylix again said there was a new clx to be released. It was a bit delayed. Didn't it mean it stopped ?? There are also BCB and bcbx's new products, which are not clear about Borland's product positioning, or are there any problems in other words ??