我做的一个程序,现在要求是在800*600的15吋显示器上用,过一会要在1024*768上用那么窗体大小怎么做?(我现在是用的800*570,top:=0,left:=0)

解决方案 »

  1.   

    if (Screen.Width = 1024) and (Screen.Height = 768) then 
    ...
    if (Screen.Width = 800) and (Screen.Height = 600) then 
    ...
      

  2.   


    1:anchors属性
    2:用panel3:ConstOrignwidth=800;Orignheight=600;
    procedure TForm1.FormCreate(Sender:TObject);beginscaled:=true;if (screen.width<>orignwidth) thenbeginheight:=longint(height)*longint(screen.height)divorignheight;width:=longint(width)*longint(screen.width)divorignwidth;scaleby(screen.widthorignwidth);end;end;