如何在C#中自定义打开文件对话框 [英] How to create customized open file dialog in C#

查看:177
本文介绍了如何在C#中自定义打开文件对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何才能创建具有的OpenFileDialog在C#相同的功能(有一些扩展功能一起)的用户控件?我已经按照,但我无法找到一个为解决我的问题。

How can one create a user control that has the same functionality (along with some extended features) of OpenFileDialog in C#? I've followed this, but I could not find a solution for my problem.

我的要求是在对话框中添加额外的按钮。如果该按钮被点击然后家长应以同样的方式为通知确定取消按钮的功能。

My requirement is to add an extra button in the dialog. If that button gets clicked then the parent should be notified in the same manner as the ok and cancel buttons do.

推荐答案

打开文件对话框 是一个密封类,因此不能被继承或延长。最好的办法是写自己的打开文件对话框。

The OpenFileDialog is a sealed class, and as such can't be inherited or extended. Your best bet would be to write your own open file dialog.

在另一方面,该的 的FileDialog 类是不密封,所以你可以继承这并进行必要的自定义设置。请参见 http://www.codeproject.com/KB/dialog/OpenFileDialogEx.aspx了解更多信息。

On the other hand, the FileDialog class isn't sealed, so you could inherit from that and make the necessary customizations. See http://www.codeproject.com/KB/dialog/OpenFileDialogEx.aspx for more information

这篇关于如何在C#中自定义打开文件对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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