现在的位置: 首页 > 综合 > 正文

在窗口中打开子窗口

2012年09月14日 ⁄ 综合 ⁄ 共 532字 ⁄ 字号 评论关闭

 

子窗口

private void btn_OK_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

父窗口

 

  Form4 f4 = new Form4();
                //f4.Location =
                Point point = this.Location;
                point.X += 220;
                point.Y -=330;
                f4.Location = point;//设定弹窗位置哟

                if (f4.ShowDialog(this) == DialogResult.OK)
                {}

 

 

 

show()方法,只是显示出来

showdialog(),是模态效果

抱歉!评论已关闭.