Search code examples
c#openfiledialog

OpenFileDialog - Filter out files with specific words


I know I can write a custom dialog to do what I'm looking for, but is it possible to set a filter with OpenFileDialog to get .txt files, but only if they doesn't have "_org" in the filename?


Solution

  • Hey you can subscribe the OpenFileDialog.FileOk-Event to check the user selection of file names. if any filename incorrect you can cancel the event an show a message! otherwise you must write a custom dialog.