Form.ShowDialog和Form.DialogResult

The dialog result of a form is the value that is returned from the form when it is displayed as a modal dialog box.

If the form is displayed as a dialog box, setting this property with a value from the DialogResult enumeration sets the value of the dialog box result for the form, hides the modal dialog box, and returns control to the calling form.

 

把一个窗体以showdialog的方式显示出来之后,点击了窗体上的一个按钮后,系统会自动将按钮的dialogresult属性赋值给窗体的属性

This property is typically set by the DialogResult property of a Button control on the form.

When the user clicks the Button control, the value assigned to the DialogResult property of the Button is assigned to the DialogResult property of the form.

posted @ 2015-02-27 15:29  ChuckLu  阅读(595)  评论(0编辑  收藏  举报