type
TForm1 =
class(TForm)
//...
// OnPaint für den Dialog
procedure MessageDlgPaint(Sender: TObject);
private
{ Private-Deklarationen }
FMessageDlg : TForm;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
FMessageDlg := CreateMessageDialog('
Wie gehts ?',mtWarning,[mbyes,mbno]);
FMessageDlg.OnPaint := MessageDlgPaint;
end;
procedure TForm1.MessageDlgPaint(Sender: TObject);
var
i,f,r,g:Integer;
begin
f:=Round(255/Height);
r:=0;
g:=255;
FMessageDlg.Canvas.Pen.Color:=
RGB(r,g,100);
for i:=0
TO FMessageDlg.Height
do begin
FMessageDlg.Canvas.MoveTo(0,i);
FMessageDlg.Canvas.LineTo(Width,i);
Inc(r,f);
Dec(g,f);
FMessageDlg.Canvas.Pen.Color:=
RGB(r,g,100);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if FMessageDlg.Showmodal = mrNo
then exit;
end;