请问一下如何让窗体一运行自动居中啊!

解决方案 »

  1.   

    Form1.Position := poDesktopCenter;
      

  2.   

    or Form1.Position := poScreenCenter
      

  3.   

    窗体的  position 属性设为 poScreenCenter
      

  4.   

    在form1的create事件用。。
    Form1.Position := poDesktopCenter;
      

  5.   

    Represents the size and placement of the form.Delphi syntax:type TPosition = (poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter);Delphi syntax:property Position: TPosition;DescriptionUse Position to get or set the size and placement of the form. Position can have one of the following TPosition values:Value MeaningpoDesigned The form appears positioned on the screen and with the same height and width as it had at design time.
    poDefault The form appears in a position on the screen and with a height and width determined by the operating system. Each time you run the application, the form moves slightly down and to the right. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.poDefaultPosOnly The form displays with the size you created it at design time, but the operating system chooses its position on the screen. Each time you run the application, the form moves slightly down and to the right. When the form can no longer move down and to the right and keep the same size while remaining entirely visible on the screen, the form displays at the top-left corner of the screen.
    poDefaultSizeOnly The form appears in the position you left it at design time, but the operating system chooses its size. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.poScreenCenter The form remains the size you left it at design time, but is positioned in the center of the screen. In multi-monitor applications, the form may be moved from this center position so that it falls entirely on one monitor, as specified by the DefaultMonitor property. 
    poDesktopCenter The form remains the size you left it at design time, but is positioned in the center of the screen. No adjustments are made for multi-monitor applications.
    poMainFormCenter The form remains the size you left it at design time, but is positioned in the center of the application抯 main form. No adjustments are made for multi-monitor applications. This position should only be used with secondary forms. If set for a main form, it acts like poScreenCenter.poOwnerFormCenter The form remains the size you left it at design time, but is positioned in the center of the form specified by the Owner property. If the Owner property does not specify a form, this position acts like poMainFormCenter.
      

  6.   

    偶都想问.偶一直用双显示器(两张显卡),Desktop的边界经常是负值.
      

  7.   

    哦,可以这样在:
    在formcreate事件中:
    form1.left:=(screen.width-form1.width) div 2;
    form1.top:=(screen.height-form1.height) div 2;
    这样就可以保证居中了!!
      

  8.   

    Form1.Position := poScreenCenter
    Form1.Position := poDesktopCenter
      

  9.   

    Form1.Position := poDesktopCenter;
      

  10.   

    Form1.Position := poDesktopCenter;
      

  11.   

    from.position:属性
    poscreencenter :中央,考虑多个显示器
    podesktopcenter:中央,不考虑多个显示器
      

  12.   

    说的人好多啊,怎么出来这么多POSITION,郁闷,点下FORM,在FORM的设置里好象就有的,找A开头的试下,@_@
      

  13.   

    Form1.Position := poScreenCenter
      

  14.   

    在formcreate事件中:
    TForm.Position:=poDesktopCenter
    或直接在position属性中设置啊