unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
procedure Label1MouseLeave(Sender: TObject);
procedure Label1MouseEnter(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Label1MouseLeave(Sender: TObject);
begin
Label1.Font.Color:=clBlue;
end;
procedure TForm1.Label1MouseEnter(Sender: TObject);
begin
Label1.Font.Color:=clRed;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Font.Color:=clBlack;
end;
end.
已测试:Windows 2003+Delphi7
给分吧