StartPosition屬性有如下選項
StartPosition屬性有如下選項,分別含義如下:
CenterParent 窗體在其父窗體中居中。
CenterScreen 窗體在當前顯示窗口中居中,其尺寸在窗體大小中指定。
Manual 窗體的位置由 Location 屬性確定。
WindowsDefaultBounds 窗體定位在 Windows 默認位置,其邊界也由 Windows 默認決定。
WindowsDefaultLocation 窗體定位在 Windows 默認位置,其尺寸在窗體大小中指定。
CenterScreen的意思並不是屏幕居中(是相對的),它是在"當前顯示窗口"中居中。
當用Show()方法時應選擇CenterScreen,
用ShowDialog()方法時應選擇CenterParent,這樣才能讓要顯示的窗口居中。
CenterParent 窗體在其父窗體中居中。
CenterScreen 窗體在當前顯示窗口中居中,其尺寸在窗體大小中指定。
Manual 窗體的位置由 Location 屬性確定。
WindowsDefaultBounds 窗體定位在 Windows 默認位置,其邊界也由 Windows 默認決定。
WindowsDefaultLocation 窗體定位在 Windows 默認位置,其尺寸在窗體大小中指定。
CenterScreen的意思並不是屏幕居中(是相對的),它是在"當前顯示窗口"中居中。
當用Show()方法時應選擇CenterScreen,
用ShowDialog()方法時應選擇CenterParent,這樣才能讓要顯示的窗口居中。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.