本帖最后由 eznanke 于 2010-04-01 15:26:45 编辑

解决方案 »

  1.   

    更改groupbox 的宽度跟高度
      

  2.   


            private void button3_Click(object sender, EventArgs e)
            {
                grpBoxAdvanced.Visible = !grpBoxAdvanced.Visible;
                int height = grpBoxAdvanced.Height;
                if (grpBoxAdvanced.Visible)
                {
                    this.Height += height;
                    button1.Top += height;
                    button2.Top += height;
                    button3.Top += height;
                    button3.Text = "隐藏高级设置";
                }
                else
                {
                    this.Height -= height;
                    button1.Top -= height;
                    button2.Top -= height;
                    button3.Top -= height;
                    button3.Text = "显示高级设置";
                }
            }