D
del_today
Unregistered / Unconfirmed
GUEST, unregistred user!
请问各位高手:
在下列程序中,语句“PaintBox1.Repaint;”是否调用过程
“procedure TForm1.PaintBox1Paint(Sender: TObject);”???
procedure TForm1.FormCreate(Sender: TObject);
begin
Shape:=4;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
With Sender as TPaintBox do
if Shape=1 then
begin
Canvas.Pen.Color:=clBlack;
Canvas.Ellipse(0,0,30,30);
end
else begin
if shape=2 then
begin
Canvas.Pen.Color:=clRed;
Canvas.PolyLine([Point(40,10),Point(20,60),
Point(70,30),Point(10,30),Point(60,60),Point(40,10)]);
end
else
begin
if shape=3 then
begin
Canvas.Pen.Color:=clBlue;
Canvas.Rectangle(0,0,30,30);
end;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Shape:=1;
PaintBox1.Repaint;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Shape:=2;
PaintBox1.Repaint;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Shape:=3;
PaintBox1.Repaint;
end;
end.
在下列程序中,语句“PaintBox1.Repaint;”是否调用过程
“procedure TForm1.PaintBox1Paint(Sender: TObject);”???
procedure TForm1.FormCreate(Sender: TObject);
begin
Shape:=4;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
With Sender as TPaintBox do
if Shape=1 then
begin
Canvas.Pen.Color:=clBlack;
Canvas.Ellipse(0,0,30,30);
end
else begin
if shape=2 then
begin
Canvas.Pen.Color:=clRed;
Canvas.PolyLine([Point(40,10),Point(20,60),
Point(70,30),Point(10,30),Point(60,60),Point(40,10)]);
end
else
begin
if shape=3 then
begin
Canvas.Pen.Color:=clBlue;
Canvas.Rectangle(0,0,30,30);
end;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Shape:=1;
PaintBox1.Repaint;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Shape:=2;
PaintBox1.Repaint;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Shape:=3;
PaintBox1.Repaint;
end;
end.