我原来编写的程序一直运行良好,包括WIN2000和98两个平台。
现在,在98下会出现窗体大小和控件在窗体上的位置完全打乱,而且不同的机器,表现也不一样。只有在每台98的机器下都重新编排控件位置,编译后才解决。
哪位高手知道是什么原因啊,感谢感谢。我急死了。

解决方案 »

  1.   

    那是因为delphi不是跨平台的,也就是说位置是一个定点,不会随平台的改变而改变大小。
      

  2.   

    试试:
    const
      ScreenWidth:LongInt=800;
      ScreenHeight:LongInt=600;
      {$ R*.DFM}
      procedure TMainForm.FormCreate(Sender:TObject);
      var
      OldFormWidth:integer;
      begin
      Scaled:=TRUE;
      if(Screen.width<> ScreenWidth)then
      begin
      OldFormWidth:=Width
      Height:=longint(Height)*longint(Screen.Height)DIV S creenHeight;
      Width:=longint(Width)*longint(Screen.Width)DIV Scre enWidth;
      ScaleBy(Screen.Width,ScreenWidth);
      Font.Size:=(Width DIV OldFormWidth)*FontSize;
      end;
      end;