C#中如何设置窗体的StartPosition属性设置为右上角

2025-01-06 07:48:56
推荐回答(2个)
回答1:

this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(SystemInformation.WorkingArea.Width - this.Width, SystemInformation.WorkingArea.Height - this.Height);
右下角

回答2:

private void Form1_Load(object sender, EventArgs e)
{
this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
this.Top = 0;
}