folgendes Problem:
Ich habe 2 Formen, mit einem Button (Form2.Showmodal) rufe ich die 2. Form auf, in der sich eine Paintbox befindet.
Code: Alles auswählen
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.showmodal;
end;
Code: Alles auswählen
TForm2 = class(TForm)
PaintBox1: TPaintBox;
procedure FormPaint(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form2: TForm2;
implementation
{ TForm2 }
procedure TForm2.FormPaint(Sender: TObject);
begin
form2.PaintBox1.Canvas.FillRect(50,50,100,100);
end;
Danke für Eure Hilfe!
Michl