unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls;
type
TForm6 =
class(TForm)
Panel1: TPanel;
CheckBox1: TCheckBox;
Edit1: TEdit;
CheckBox2: TCheckBox;
Panel2: TPanel;
StatusBar1: TStatusBar;
procedure CheckBox1Click(Sender: TObject);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form6: TForm6;
implementation
{$R *.dfm}
procedure TForm6.CheckBox1Click(Sender: TObject);
begin
Panel2.Enabled :=
not CheckBox1.Checked;
end;
procedure TForm6.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
PosPoint : TPoint;
s :
string;
begin
PosPoint.X := x - Panel2.Left;
PosPoint.Y := y - Panel2.Top;
s := '
';
if Panel2.ControlAtPos( PosPoint, true, true ) <>
nil then
s := TControl( Panel2.ControlAtPos( PosPoint, true, true ) ).
Name;
StatusBar1.SimpleText := Format( '
Maus an Position %d:%d Control: %s', [ x, y, s ] );
end;
end.