在执行操作后手动设置DialogResult属性。
示例代码:
private void ConfirmButton_Click(object sender, EventArgs e) { if (SomeCondition) { DialogResult = DialogResult.OK; //手动设置DialogResult属性 Close(); } else { // 给出错误提示 } }
上一篇:绑定到DependencyProperty的TextBox vs. TextBlock
下一篇:绑定到地址http://127.0.0.1:59074失败:地址已被使用