I have a form which is displayed through: ShowDialog()
.
The form doesn't have CancelButton
specified.
When I open a BrowseDialog
from the form and then close the BrowseDialog
, the form is also closed. How can I prevent this from happening?
When the "browse"-button is clicked:
browseDialog.SelectedPath = projectLocation.Text;
browseDialog.ShowDialog();
if (browseDialog.SelectedPath != "")
{
projectLocation.Text = browseDialog.SelectedPath;
}
When the "cancel"-button of the form is clicked:
Close();