2
203010
Unregistered / Unconfirmed
GUEST, unregistred user!
TCDateTimePicker = class(TDateTimePicker)
private
procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY;
end;
{ TCDateTimePicker }
function IsBlankSysTime(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 IsBlankSysTime(PNMDateTimeChange(NMHdr)^.st))) then
DateTime := SystemTimeToDateTime(PNMDateTimeChange(NMHdr)^.st);
end;
inherited;
end;
请提出宝贵意见
private
procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY;
end;
{ TCDateTimePicker }
function IsBlankSysTime(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 IsBlankSysTime(PNMDateTimeChange(NMHdr)^.st))) then
DateTime := SystemTimeToDateTime(PNMDateTimeChange(NMHdr)^.st);
end;
inherited;
end;
请提出宝贵意见