怎样才能实现程序自适应屏幕的大小?就是我在1024*768写的程序在800*600中所有的控件都能显示出来?

解决方案 »

  1.   

    你自己case 屏幕大小去控制不就行了嗎
      

  2.   

    同意楼上,利用screen的width和height,自己重新定位控件位置。
    比如**.left:=screen.width-100;之类的。
      

  3.   

    取得screen的width和height,然后根据比例(比如你是800×600开发的很棒),然后设置遍历Form以及Form上的控件,计算大小和位置。
      

  4.   

    给出代码:
    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;
      

  5.   

    可能TControl更好一些,因为可视化组建全部集成自TControl.