unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Panel3MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
panel1.Color:=clBlue;
panel1.Caption:='Biru';
panel2.Color:=clBtnFace;
panel3.Color:=clBtnFace;
end;
procedure TForm1.Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
panel2.Color:=clRed;
panel2.Caption:='Merah';
panel1.Color:=clBtnFace;
panel3.Color:=clBtnFace;
end;
procedure TForm1.Panel3MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
panel3.Color:=clgreen;
panel3.Caption:='Hijau';
panel1.Color:=clBtnFace;
panel2.Color:=clBtnFace;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
panel1.Color:=clBtnFace;
panel2.Color:=clBtnFace;
panel3.Color:=clBtnFace;
panel1.Caption:='';
panel2.Caption:='';
panel3.Caption:='';
end;
end.
sekian semoga bermanfaat....semangat untuk menggali kemampuan anda.
Post a Comment