2013-02-06 28 views
-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; 
+1

不要调用PointToScreen,它已经在屏幕坐标中。 –

回答

0

你需要显示窗口前设置点配置。

+0

不要工作。小组形式出现在主窗体的边框中。为什么? – user2046634