我在这个主题中找到了答案。因此,为了节省大小和位置而不产生副作用,需要删除绑定并手动保存应用程序设置
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.Size = this.Size;
Properties.Settings.Default.Location = this.Location;
Properties.Settings.Default.Save();
}
private void Form1_Load(object sender, EventArgs e)
{
this.Size = Properties.Settings.Default.Size;
this.Location = Properties.Settings.Default.Location;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1994 次 |
| 最近记录: |