将WinForm置于右下角

25 .net c# winforms

如何在使用C#加载时在屏幕的右下角放置一个表单?

Noa*_*Gal 60

尝试一下就行了

Rectangle workingArea = Screen.GetWorkingArea(this);
this.Location = new Point(workingArea.Right - Size.Width, 
                          workingArea.Bottom - Size.Height);
Run Code Online (Sandbox Code Playgroud)

希望它适合你.


ada*_*ost 13

Form2 a = new Form2();
a.StartPosition = FormStartPosition.Manual;
a.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - a.Width, 
                       Screen.PrimaryScreen.WorkingArea.Height - a.Height);
Run Code Online (Sandbox Code Playgroud)


And*_*lin 7

这对我有用;我只是将下面列出的代码放在我的后面InitializeComponent();

public FormProgress()
{
    this.StartPosition = FormStartPosition.Manual;
    this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
}
Run Code Online (Sandbox Code Playgroud)