如何在C#中自定义打开文件对话框

编程入门 行业动态 更新时间:2024-10-08 04:28:37
本文介绍了如何在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 类是不密封,所以你可以继承这并进行必要的自定义设置。请参见 www.codeproject/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 www.codeproject/KB/dialog/OpenFileDialogEx.aspx for more information

更多推荐

如何在C#中自定义打开文件对话框

本文发布于:2023-05-25 14:17:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/308254.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   对话框   文件   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!