-1
我是新用户,使用Winform。我有一个问题来定位主窗体应用程序上的子窗体对话框。我想将它移动到主窗体窗口的右下角,但我的代码不起作用。我不明白。请帮帮我 。主窗体上的位置对话窗体
basketForm = new Basket();
basketForm.Owner = this;
basketForm.Show();
Point pt = new Point(0, 0);
pt.X = this.Right - basketForm.Width;
pt.Y = this.Bottom - basketForm.Height;
pt = this.PointToScreen(pt);
basketForm.Location = pt;
不要调用PointToScreen,它已经在屏幕坐标中。 –