Yuresh Karunanayake
Yuresh Karunanayake

Reputation: 567

Form.ShowDialog() return 'No'?

I declared a form in a c# auto updater programme

SharpUpdateDownloadForm form = new SharpUpdateDownloadForm(update.Uri, update.MD5, applicationInfo.ApplicationIcon);
//applicationInfo.Context is 'myForm1'     
DialogResult result = form.ShowDialog(applicationInfo.context);

what is the reason that 'form.ShowDialog(applicationInfo.context)' return 'NO as the result ?

Upvotes: 0

Views: 99

Answers (1)

Sefe
Sefe

Reputation: 14007

The DialogResult will show you the outcome of the modal operation that is performed on the form. The most common way to determine the result is with the button the user has pressed. In case of DialogResult.No, the user has pressed the No button (usually on a Yes/No or Yes/No/Cancel dialog).

Having said that, eventually it is up to the form to determine the result it returns. In case the form closes itself, it will automatically determine a result. Which result that is depends on the implementation of the form. So you should check SharpUpdateDownloadForm for what it does or referer to the respective documentation (if available).

Upvotes: 2

Related Questions