这只是一个放大窗体上可视化控件大小的方法,参考一下 :)
procedure ResizeWinControl;
var
iPercentage:integer;
i:integer;
begin
for i:=0 to Application.ComponentCount-1 do
begin
if (Application.Components is TWinControl) then
begin
if Screen.Width > 640 then
begin
iPercentage:=Round(((Screen.Width-640)/640)*100)+100;
TWinControl(Application.Components).ScaleBy(iPercentage,100);
end;
end;
end;
end;
var
Form1: TForm1;
FormW : Integer;
FormH : Integer;
procedure TForm1.FormResize(Sender: TObject);
var
i : Integer;
begin
if (Width<>FormW) then
begin
for i:=0 to Application.ComponentCount-1 do
begin
if (Application.Components is TWinControl) then
begin
((Application.Components) as TWinControl).scaleby(Width,FormW);
end;
end;
FormW := Width;
FormH := Height;
end;
end;