转载自:http://www.bkjia.com/Asp_Netjc/858195.html
设置StartPosition属性 有如下选项,分别含义如下:
CenterParent 窗体在其父窗体中居中。 CenterScreen 窗体在当前显示窗口中居中,其尺寸在窗体大小中指定。 Manual 窗体的位置由 Location 属性确定。 WindowsDefaultBounds 窗体定位在 Windows 默认位置,其边界也由 Windows 默认决定。 WindowsDefaultLocation 窗体定位在 Windows 默认位置,其尺寸在窗体大小中指定。
CenterScreen的意思并不是屏幕居中(是相对的),它是在”当前显示窗口”中居中。
当用Show()方法时应选择CenterScreen,窗体进度条可以使用
用ShowDialog()方法时应选择CenterParent,这样才能让要显示的窗口居中,活动窗体为弹出的窗体。
C#中怎设置窗体的StartPosition属性设置为右下角
startpostion属性不能实现你这功能,要在代码里写,
在构造函数里加下面两句即可: this.StartPosition = FormStartPosition.Manual; this.Location = new Point(SystemInformation.WorkingArea.Width - this.Width, SystemInformation.WorkingArea.Height - this.Height);
用Location属性及SetBounds方法设置它的位置 Form2 f2 = new Form2(); f2.StartPosition = FormStartPosition.Manual; f2.Location = new Point(0, 0); f2.Show();