What can modal forms return?

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I want to show a form Modally and return a value.

Checking the documentation it looks like I need to return one of the
DialogResults.

Is that true or can I return any value?

Thinking I must return one of the DialogResult enumerations I did the
following.

Is that the way people do it?

Thanks



Public Enum PrintQuery

PrintThisPage = DialogResult.Yes

SkipThisPage = DialogResult.No

StopPrinting = DialogResult.Abort

CancelEntireDocument = DialogResult.Cancel

End Enum



Private Sub btnStopPrinting_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnStopPrinting.Click

DialogResult = PrintQuery.StopPrinting

End Sub
 
Hi,

ShowDialog only returns a dialogresult. I return a dialogresult.ok if
the data on the form is valid and the user doesn't press the cancel
button. You can pass the data back to the original form through a forms
property.

Ken
---------------------
 
Thanks for the info.


Ken Tucker said:
Hi,

ShowDialog only returns a dialogresult. I return a dialogresult.ok if
the data on the form is valid and the user doesn't press the cancel
button. You can pass the data back to the original form through a forms
property.

Ken
 
Back
Top