Bermain Mouse Over - Ilmu Alakadarnya
Wie lautet meine IP

Bermain Mouse Over

Hallo agan-agan yang budiman hehe nainan mouse over di delphi yuk ni aku punya sedikit rumusnya. tapi sebelumnya buka delphi anda dan sediakan 3 panel dari pallet standart terus masukkan rumus seperti di bawah yang aku kasih warna merah ya....eh ia semua rumus tersebut di tulis di bagian mouse over pada setiap panel dan form. 



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.
Share this article :
 

Post a Comment