相同的分辨率(800*600)的delphi界面,为什么显示的效果不一样?
程序在windows2000下开发,在windows98下显示的界面上的控件有的显示不下。是否需要修改win98的注册表?

解决方案 »

  1.   

    是你的Win2000下开发的字体在98下面没有的缘故,你用默认的字体就好了
      

  2.   

    将窗体的Scaled设为:False;
    将窗体的字体设为宋体
      

  3.   

    在win2000或xp 下编程时,记住将窗体的Font的字符集设为Chinese_GB2312,或直接将Font.Charset设为GB2312_Charset另外,有时还要将窗体的Scaled属性设为false(绝大多数情况下没有必要).控件的parentFont如果为true(默认),则窗体的字符集变了,它们的也会跟着变,没有必要逐个设置;除非控件的字体特殊,有别于窗体,则需要单独设置。还有适应分辨率的问题:
    假设你在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
      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;