Is it possible to disable the cancel button of OpenFileDialog?

Can I set the cancel button OpenFileDialog enable = false? If so, how?

I am using winforms

Edit

OpenFileDialog file_open_dialog = new OpenFileDialog();
+3
source share
3 answers

I do not believe so and not without reason! Are you sure you want to disable the "Cancel" button? Since this is a modal dialog, this will prevent the user from continuing (and therefore make your application unusable) until a file is selected - there will almost certainly be scenarios where it is simply impossible, or the user does not want to force the file to be saved.

, , , , , Microsoft , OpenFileDialog .

, , .

+4

handle undo in a loop if you want? may interfere with users;)

do
  {}
while (openFileDialog1.ShowDialog() != DialogResult.OK);
0
source

Source: https://habr.com/ru/post/1769473/


All Articles