Is there is already some property that I could use such as:
if (this.IsDialog)
{
DialogResult = ...;
}
else
{
//do something else
}
Or should I create such property myself and set it to true
before showing the form as dialog?
Show() method shows a windows form in a non-modal state. ShowDialog() method shows a window in a modal state and stops execution of the calling context until a result is returned from the windows form open by the method.
ShowDialog() Shows the form as a modal dialog box. ShowDialog(IWin32Window) Shows the form as a modal dialog box with the specified owner.
You can check to see if this.Modal
is true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With