unit Unit1;
interface
uses
SysUtils, Graphics, Forms, StdCtrls, Classes, Controls, ExtCtrls;
type
TForm1 = class(TForm)
PB: TPaintBox;
E1: TEdit;
procedure PBPaint(Sender: TObject);
procedure PBMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure PBMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCreate(Sender: TObject);
private
{ By : Zephio }
public
{ http://amateur-guide.blogspot.com }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.PBPaint(Sender: TObject);
begin
with PB.Canvas do
begin
Brush.Style := BSClear;
Pen.Style := PSSolid;
Font.Size := 24;
Font.Style := [FSBold];
Font.Name := 'Verdana';
Font.Color := ClGray;
TextOut(0, 0, 'Generate');
Font.Color := CLBlue;
TextOut(2, 2, 'Generate');
end;
end;
procedure TForm1.PBMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
with PB.Canvas do
begin
Brush.Style := BSClear;
Pen.Style := PSSolid;
Font.Size := 24;
Font.Style := [FSBold];
Font.Name := 'Verdana';
Font.Color := ClGray;
TextOut(0, 0, 'Generate');
Font.Color := CLRed;
TextOut(2, 2, 'Generate');
end;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
PBPaint(Self);
end;
procedure TForm1.PBMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button <> MBLeft then
Exit
else
with PB.Canvas do
begin
Brush.Style := BSClear;
Pen.Style := PSSolid;
Font.Size := 24;
Font.Style := [FSBold];
Font.Name := 'Verdana';
Font.Color := ClGray;
TextOut(0, 0, 'Generate');
Font.Color := ClLIme;
TextOut(2, 2, 'Generate');
end;
E1.Text := IntToHex(Random(999999), 8);
E1.Font.Color := Random(99999);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DoubleBuffered := true;
Randomize;
end;
end.
interface
uses
SysUtils, Graphics, Forms, StdCtrls, Classes, Controls, ExtCtrls;
type
TForm1 = class(TForm)
PB: TPaintBox;
E1: TEdit;
procedure PBPaint(Sender: TObject);
procedure PBMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure PBMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCreate(Sender: TObject);
private
{ By : Zephio }
public
{ http://amateur-guide.blogspot.com }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.PBPaint(Sender: TObject);
begin
with PB.Canvas do
begin
Brush.Style := BSClear;
Pen.Style := PSSolid;
Font.Size := 24;
Font.Style := [FSBold];
Font.Name := 'Verdana';
Font.Color := ClGray;
TextOut(0, 0, 'Generate');
Font.Color := CLBlue;
TextOut(2, 2, 'Generate');
end;
end;
procedure TForm1.PBMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
with PB.Canvas do
begin
Brush.Style := BSClear;
Pen.Style := PSSolid;
Font.Size := 24;
Font.Style := [FSBold];
Font.Name := 'Verdana';
Font.Color := ClGray;
TextOut(0, 0, 'Generate');
Font.Color := CLRed;
TextOut(2, 2, 'Generate');
end;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
PBPaint(Self);
end;
procedure TForm1.PBMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button <> MBLeft then
Exit
else
with PB.Canvas do
begin
Brush.Style := BSClear;
Pen.Style := PSSolid;
Font.Size := 24;
Font.Style := [FSBold];
Font.Name := 'Verdana';
Font.Color := ClGray;
TextOut(0, 0, 'Generate');
Font.Color := ClLIme;
TextOut(2, 2, 'Generate');
end;
E1.Text := IntToHex(Random(999999), 8);
E1.Font.Color := Random(99999);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DoubleBuffered := true;
Randomize;
end;
end.
No comments:
Post a Comment