我在WIN200+DELPHI5做的软件,在WIN98下打开后,窗口中的控件变的很大,字体也变大了,窗口的WIDTH和HEIGHT也变大了。

解决方案 »

  1.   

    无药可救。除非有特别处理。而这些特别处理,已经不涉及到甚至FONT之类!
    采取其它的排放方法可以避免这些问题。注意测试.或者尽量注意使用宋体!
      

  2.   

    将form的scale设置为false即可解决
      

  3.   

    那是分辨的问题.采用的方法有二种.主动式和被动式.
    主动式是改变你开发时所用的分辨率那样会缩小你软件上的字体等.被动式是改变当前显示器的分辨率适合你的软件.先改到你规定的分辨率,软件退出时改回原来的设置.
    oldwidth,oldheight,oldfreq:integer;//全局变量用来保存原来的设置.
    newwidth//新的行宽
    newheight//新的高
    newfrquency//新的刷新率
    oldwidth//原来的行距
    oldheight//高
    oldfreq//原来的刷新率
    procedure Tmain.setscreen(newwidth, newheight, newfrquency:integer);
    var
      devmode:Tdevicemode;
    begin
      OldWidth:=GetSystemMetrics(SM_CXSCREEN);
      OldHeight:=GetSystemMetrics(SM_CYSCREEN);
      if (oldwidth<>newwidth) and (oldheight<>newheight) then
      begin
      DevMode.dmSize:=sizeof(TDeviceMode);
      EnumDisplaySettings(nil, DWORD(-1), DevMode);
      DevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT or DM_DISPLAYFREQUENCY;
      DevMode.dmPelsWidth:=NewWidth;
      DevMode.dmPelsHeight:=NewHeight;
      OldFreq:= DevMode.dmDisplayFrequency;
      DevMode.dmDisplayFrequency:=newfrquency;
      ChangeDisplaySettings(DevMode,0);
      end;
    end;
    procedure Tmain.FormCreate(Sender: TObject);
    begin
    setscreen(1024,768,85);
    end;procedure Tmain.FormDestroy(Sender: TObject);
    begin
    setscreen(oldwidth,oldheight,oldfreq);
    end;
      

  4.   

    上面说得是被动式,主动式的做法如下;
    Const
      Owidth=800;
      Oheight=600;procedure TForm1.FormCreate(Sender:TObject);
    begin
      scaled:=true;
      if (screen.width<>owidth) and (screen.height<>oheight)then
      begin
        height:=longint(height)*longint(screen.height)divorignheight;
        width:=longint(width)*longint(screen.width)divorignwidth;
        scaleby(screen.width,owidth);
      end;
    end;
      

  5.   

    应该是你的win98上使用的大字体。在桌面属性中可以设置。另外,最好在程序启动时将字体设成宋体,9号,因为win2000下默认的sans serif到了win98下会很难看的。