Advertisement

WPF 通过ShowDialog方法获取窗口返回值

阅读量:
复制代码
    usingusingusingnamespacepublicpartialclasspublic// The accept button is a button whose IsDefault property is set to true.// This event is raised whenever this button is clicked, or the ENTER key// is pressed.voidobject// Accept the dialog and return the dialog resultthistrue
复制代码

当DialogResult属性被设定为true或false后,窗口将随之关闭,此时ShowDialog()方法的返回值即为所设置的DialogResult值,进而可通过判断该返回值的具体内容来确认用户的操作意图。

全部评论 (0)

还没有任何评论哟~