unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
FMessageDlg : TForm;
procedure MessageDlgPaint(Sender: TObject);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
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;
Type
TMessageForm =
class(TForm)
private
Message: TLabel;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FMessageDlg := CreateMessageDialog('
Wie gehts ?',mtWarning,[mbyes,mbno]);
TMessageForm(FMessageDlg).
Message.Transparent:=True;
FMessageDlg.OnPaint := MessageDlgPaint;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if FMessageDlg.Showmodal = mrNo
then exit;
end;
end.