unit MYDATETIMEPICKER;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls;
type
TMYDATETIMEPICKER = class(TDateTimePicker)
private
{ Private declarations }
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TMYDATETIMEPICKER]);
end;
{ TMYDATETIMEPICKER }
procedure TMYDATETIMEPICKER.WMPaint(var Message: TWMPaint);
var
BtnFaceBrush, WindowBrush: HBRUSH;
dc : hdc;
r : TRect;
begin
inherited;
DC := GetWindowDC(Handle);
try
BtnFaceBrush := CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
WindowBrush := CreateSolidBrush(GetSysColor(COLOR_WINDOW));
try
GetWindowRect(Handle, R);
OffsetRect (R, -R.Left, -R.Top);
FrameRect (DC, R, BtnFaceBrush);
InflateRect (R, -1, -1);
FrameRect (DC, R, BtnFaceBrush);
InflateRect (R, -1, -1);
FrameRect (DC, R, WindowBrush);
finally
DeleteObject (WindowBrush);
DeleteObject (BtnFaceBrush);
end;
finally
ReleaseDC(Handle, DC);
end;
end;
end.