开发者

Can OpenFileDialog receive filename *.*?

开发者 https://www.devze.com 2023-04-12 03:35 出处:网络
I want to use OpenFileDialog as selecting file wit开发者_如何学Ch expression( .or *.zip) On File Name EditBox.

I want to use OpenFileDialog as selecting file wit开发者_如何学Ch expression( . or *.zip) On File Name EditBox.

Do I have to override OpenFileDialog ? if then, please give me a tip about it.

At now, If I put file name as . and click 'open' , the OpenFileDialog doesn't return anything.

Sorry about my poor English.

Can OpenFileDialog receive filename *.*?


Looks like you want to filter the possible file types of the file dialog. You can do that like this:

myOpenFileDialog.Filter = "Zip Files|*.zip";

If you want to allow several file types, you can just extend the list with several |'s

myOpenFileDialog.Filter = "Zip Files|*.zip|All Files|*.*";


You can't do what you want with OpenFileDialog. It wraps up the common Windows component which has special treatment for file names that contain wildcards. Those are interpreted as filters for the file list view.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号