c# - file filter in open file dialog -


i add checks openfiledialog show files except .exe , .jar.

  var openfiledialog = new microsoft.win32.openfiledialog             {                 title = @"upload file",                 filter =                     @"all files|*.*|text file (.txt)|*.txt|word file (.docx ,.doc)|*.docx;*.doc|pdf (.pdf)|*.pdf|spreadsheet (.xls ,.xlsx)|  *.xls ;*.xlsx|presentation (.pptx ,.ppt)|*.pptx;*.ppt",                 filterindex = 1,                 restoredirectory = true             }; 

the files options allows files . not files of type specified after . if user selects 1 type , ssay .txt drop down , other files not shown. files option shows files including exe , jar.

i want implement option specifiy 5 file types , above , , files option shows 5 file types instead of file types.

since filter files *.* file types shown, naturally... can work around specifying filter files like

filter = @"all files|*.txt;*.docx;*.doc;*.pdf*.xls;*.xlsx;*.pptx;*.ppt|text file (.txt)|*.txt|word file (.docx ,.doc)|*.docx;*.doc|pdf (.pdf)|*.pdf|spreadsheet (.xls ,.xlsx)|  *.xls ;*.xlsx|presentation (.pptx ,.ppt)|*.pptx;*.ppt" 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -