I've gotten my brain in a knot over the simple task of getting an application directory from the user. I have an AppFolderDialog form, which I use as a dialogue, on which there are OK and Cancel buttons, a read only textbox, and a Browse button. The browse button opens up a FolderBrowserDialog.
Now when the user clicks OK, I need a loop to check if the selected directory contains a certain file, and give the user a Cancel or Retry message box. Cancel will forward the cancel to the dialogue to close it and return DialogResult.Cancel. Retry will simply give the user another chance to browse for a directory.
Now I also need a Cancel button on the dialogue itself, so the user can cancel without having to select an invalid directory. I know I have this all wrong, but I'm busy with many things at once, and my concentration is shot. I would appreciate some suggestions as to how to improve this task in the application.