在窗口中打开子窗口

子窗口

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(),是模态效果

原文地址:https://www.cnblogs.com/qq4004229/p/2503689.html