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();
I would guess that the button you use to show the BrowseDialog has its DialogResult set to something other than None.
If this is not the case, please post some code.