C# WinForm 怎么让窗体不能移动?

2024-11-27 11:52:12
推荐回答(1个)
回答1:

先记录location,再在LocationChanged或move事件里把记录下的值再给location
private Point point;
private void Form1_Load(object sender, EventArgs e)
{
point = this.Location;
}
private void Form1_Move(object sender, EventArgs e)
{
this.Location = point;
}