문제

I have a mdi application from which I want to call a mdi child form. This form has to return a value on closing to its parent. How can I manage that without using ShowDialog()?

도움이 되었습니까?

해결책

You can handle the OnClosing event of the child form and set a value of a variable of the parent form class before closing.

private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
    Form1.myVar = 3;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top