我在Win2000下写的程序,在Win98下运行窗体和字体变得很大,是何原因?把程序拿到Win98下重新设置窗体大小、字体格式,再编译,这时在Win98下正常但在Win2000下运行改过的EXE窗体和字体变得很小。:(
    只有把程序完全在Win98下重新编写编译,在Win98和Win2000两种环境中才都没问题!
    在下迷惑?为何?如何解决?还望各位赐教! 

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1230/1230903.xml?temp=.8273584
      

  2.   

    我也遇到
    将Font属性下的Height设为固定值。如-12
      

  3.   

    假设你在800*600的分辨率下设计的form,第一步:
    inplementation
    const
      ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
      ScreenHeight: LongInt = 600;{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
    begin
      scaled := true;
      if (screen.width <> ScreenWidth) then
      begin
        height := longint(height) * longint(screen.height) div ScreenHeight;
        width := longint(width) * longint(screen.width) div ScreenWidth;
        scaleBy(screen.width, ScreenWidth);
      end;
    end;下一步,要让每个子控制的字体改变到合适的大小:
    type
      TFooClass = class(TControl); { needed to get at protected }
                                   { font property }var
      i: integer;
    begin
      for i := ControlCount - 1 downto 0 do
        TFooClass(Controls[i]).Font.Size :=
            (NewFormWidth div OldFormWidth) *
            TFooClass(Controls[i]).Font.Size;
    end;