给出代码: procedure TForm1.Button1Click(Sender: TObject); var i:integer; t:TWinControl; begin for i := 0 to Self.ComponentCount - 1 do if (self.Components[i] is TWinControl) then begin t :=(self.Components[i] as TWinControl); t.left :=Trunc(t.left*(Screen.width/1024)); t.top :=Trunc(t.Top*(Screen.Height/768)); t.Width :=Trunc(t.Width*(Screen.Width/1024)); t.Height :=Trunc(t.Height*(Screen.Height/768)); end; end;
比如**.left:=screen.width-100;之类的。
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
t:TWinControl;
begin
for i := 0 to Self.ComponentCount - 1 do
if (self.Components[i] is TWinControl) then
begin
t :=(self.Components[i] as TWinControl);
t.left :=Trunc(t.left*(Screen.width/1024));
t.top :=Trunc(t.Top*(Screen.Height/768));
t.Width :=Trunc(t.Width*(Screen.Width/1024));
t.Height :=Trunc(t.Height*(Screen.Height/768));
end;
end;