在一个Form1中的Button1点击显示Form2,我想让Form2显示在Button1的下面,怎么办?
Form2 frm = new Form2();
            //frm.DesktopLocation = new Point(button1.Left, button1.Right);
            
            frm.SetDesktopLocation(button1.Left, button1.Right);
            frm.ShowDialog(this);
这样不行呢??

解决方案 »

  1.   

    frm.left = ?
    不可以么。
      

  2.   

    Form2 的样式里需要把StartPosition设置为Manual
    然后,那个button的left和right是基于form1的值吧
    如果想要用的话,还得加上form1的左右值,另外还有button的长宽
      

  3.   

    同意楼上的!!不过你直接选择使用button的值不准!!还要调整!
      

  4.   

    这个方法,如果Form1在桌面移到新的位置,Form2还是在那个位置呢
    我想,Form2的显示跟着Form1的Button1走