我制作了一个 form2 显示并且有返回 DialogResult 的按钮,但我不知道为什么这不起作用:
表格1:
private void buttonEvent_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
if (form2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
labelEvent.Text = hEvent.GetName; //Breakpoint here but it doesn't stops!
}
表格2:
String Name;
public String GetName
{
get { return Name; }
}
private void button1_Click(object sender, EventArgs e)
{
button1.DialogResult = DialogResult.OK;
this.Close();
}