有没有一种简单的方法来创建带有编码对话框的C#.NET文件对话框? [英] Is there an easy way to create a C# .NET file dialog with encoding dialog box?

查看:79
本文介绍了有没有一种简单的方法来创建带有编码对话框的C#.NET文件对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让用户在C#和VS2008中加载或保存文件时选择文件编码. 记事本的对话框的底部有一个编码下拉选项.

I'm trying to let the user select the file encoding when they load or save a file in C# and VS2008. Notepad's dialog boxes have an encoding drop down option at the bottom.

有一种方法可以执行,如此处所述: http://www.codeproject.com/KB/cs/getsavefilename.aspx.

There is a way to do it as described in here: http://www.codeproject.com/KB/cs/getsavefilename.aspx.

但是,我想知道是否有更简单的方法来做到这一点. Windows必须在某个位置内置此对话框,不是吗?

However, I'm wondering if there is any easier way to do this. Windows must have this dialog built-in somewhere, isn't it?

推荐答案

内置的对话框是Win32 API提供的标准文件打开"对话框.如您参考的代码项目"文章所述,此对话框允许通过使用挂钩进行自定义.

The dialog that is built in is the standard File Open dialog provided by the Win32 API. This dialog allows customization through the use of hooks, as described in the Code Project article you reference.

本文中描述的过程是执行此操作的唯一方法,也是Notepad和Visual Studio正在做的事情, 确实是在使用Win32文件打开对话框,并且不是自己创造的.

The process described in the article is the only way to do this and is what Notepad and Visual Studio are doing if they are really using the Win32 file open dialog and not one of their own making.

这篇关于有没有一种简单的方法来创建带有编码对话框的C#.NET文件对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆