2014年3月20日 星期四

[Delphi]視窗位置 Vcl.Forms.TPosition

調整選項以在應用程式剛開啟時,放到你所選擇的位置
以下就各個選項做說明
poDesigned
The form appears positioned on the screen and with the same height and width as it had at design time.
form 將會顯示在和你設計規劃的時候相同的大小和位置

poDefault
The form appears in a position on the screen and with a height and width determined by the operating system.
交由作業系統決定所該顯示的位置和大小,通常都會在上一個程式開啟後的位置再往右下一點



poDefaultPosOnly
The form appears with the size you created it at design time, but the operating system chooses its position on the screen.
將顯示位置交由作業系統決定,而大小則和你設計的時候一樣

poDefaultSizeOnly
The form appears in the position you left it at design time, but the operating system chooses its size.
將顯示大小交由作業系統決定,而位置則和你設計的時候一樣

poScreenCenter
The form remains the size you left it at design time, but is positioned in the center of the screen. Note that in multi-monitor applications, this may result in a form that does not fall entirely on one monitor.
將 form 的顯示位置放在螢幕的正中央,大小則和設計時期的一樣。注意當有多個螢幕時,則會顯示在所有螢幕的中央,可能無法在一個螢幕中顯示整個視窗。

poDesktopCenter
The form remains the size you left it at design time, but is positioned in the center of the screen.
將顯示位置放在主螢幕的正中央,大小則和設計時期一樣。(我用Delphi7+Win7的顯示結果和 poScreenCenter 相反)

poMainFormCenter
The form remains the size you left it at design time, but is positioned in the center of the application's main form. This position should only be used with secondary forms. If set for a main form, it acts like poScreenCenter.
form 的大小將會和設計時期一樣,但顯示位置將會是在應用程式主form的正中央。這個選項應該只在第二個之後的form才使用。如果是使用在主form,則顯示位置將會和設定為 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.
form 的大小將會和設計時期一樣,但顯示位置將會是在 Owner 的正中央,所謂的 Owner 即是你設計時所設定的 Form.Owner 屬性。如果你沒有指定 Owner 屬性到一個form,則顯示位置將會和設定為 poMainFormCenter 一樣。

原文網址:http://docwiki.embarcadero.com/Libraries/XE5/en/Vcl.Forms.TPosition

沒有留言:

張貼留言