试试这个吧,我想你是这个意思
var
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button1 := TButton.Create(Self);
Button2 := TButton.Create(Self);
Button3 := TButton.Create(Self);
with Button1 do
begin
Name := 'Button1';
Parent := Self;
Left := 112;
Top := 56;
Width := 75;
Height := 25;
Anchors := [];
Caption := 'Button1';
TabOrder := 0;
end;
with Button2 do
begin
Name := 'Button2';
Parent := Self;
Left := 192;
Top := 104;
Width := 75;
Height := 25;
Anchors := [];
Caption := 'Button2';
TabOrder := 1;
end;
with Button3 do
begin
Name := 'Button3';
Parent := Self;
Left := 272;
Top := 136;
Width := 75;
Height := 25;
Anchors := [];
Caption := 'Button3';
TabOrder := 2;
end;
其实就是你把Anchors这个属性好好设一下,就可以了,什么写代码呀,什么Panel,都不能的
就是点几个鼠标就行了!