写个例子给你吧
To wbing,
你的Qq多少阿
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormResize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormResize(Sender: TObject);
var
i,j: Integer;
WidA, HeiA: Integer;
const
Wid = 10;
Hei = 10;
begin
WidA := 0;
Form1.Canvas.Pen.Color := clred;
for i := 0 to 100 do
begin
Form1.Canvas.MoveTo(0,WidA);
Form1.Canvas.LineTo(Form1.Width,WidA);
WidA := WidA + Wid;
end;
HeiA := 0;
Form1.Canvas.Pen.Color := clblue;
for i := 0 to 100 do
begin
Form1.Canvas.MoveTo(HeiA,0);
Form1.Canvas.LineTo(HeiA,Form1.Height);
HeiA := HeiA + Hei;
end;
end;
end.