unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls;
type
TDateTimePicker =
class(ComCtrls.TDateTimePicker)
public
property OnMouseDown;
end;
TForm1 =
class(TForm)
DateTimePicker1: TDateTimePicker;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
procedure DoOnMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.DoOnMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (Button = mbLeft)
and (Sender
is TWinControl)
then
begin
ReleaseCapture;
TWinControl(Sender).Perform(WM_SYSCOMMAND, $F012, 0);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DateTimePicker1.OnMouseDown := DoOnMouseDown;
end;
end.