Click here to Skip to main content
16,017,238 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tried OpenFileDialog1.Filter = "Setting Hex files (*.)|*.";
but it showing no files.I want to show files having no extensions during Openfiledialog browser,
please tell me having ant idea.
Posted

1 solution

It's not possible with an unaltered OpenFileDialog box - it expects an extension, and windows removes the "." from files end with it, so "*." will never work.

You could probably do it, if you can hook the standard dialog (see here: http://msdn.microsoft.com/en-us/library/ms646960(VS.85).aspx[^], about 1/3 the way down, under filters) but that's a lot of work in C# for a small feature!

Is there any good reason why your Hex files have no extension? It would be a lot easier to give them a name like *.MyAppHex" or similar then filter for them.

If you really do have to do this, I would be tempted to not use the standard box at all, but re-create it's features myself - it's probably a lot easier than implementing the hooking on a standard dialog!
 
Share this answer
 
Comments
kalaivanan from Bangalore, India 18-Apr-13 2:56am    
thanks,
Hex files are executable files created in linux, its not having ant extension.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900