如何在C#中显示打开/保存/取消对话框? [英] How do I display open/save/cancel dialogue box in C#?
问题描述
你好Fellaws,
我要求在对话框中显示三个按钮。我随身携带PDFStream,我需要做的就是:
1.点击打开按钮:显示PDF并提供保存选项。
2.单击保存按钮:将PDF保存到给定路径。
2.单击关闭按钮:关闭对话框。
我知道保存对话框/打开对话框,但我错过了什么吗?
还有其他办法吗?请建议。
问候,
Pramod V
Hi Fellaws,
I have a requirement to show three buttons in a dialogue box. I have the PDFStream with me and all I need to do is:
1. Click of "Open" button: Show the PDF and give an option to save it.
2. Click of "Save" button: Save the PDF to given path.
2. Click of "Close" button: Close the dialogue.
I am aware Save dialogue/Open dialogue boxes, but am I missing something?
Is there any other approach to this. Please suggest.
Regards,
Pramod V
推荐答案
我在考虑使用System.Windows.Forms
I am thinking of using System.Windows.Forms
如果我理解你,你想通过点击按钮调用打开/保存对话框。请参阅:
1。单击打开按钮:显示PDF并提供保存选项。
OpenFileDialog [ ^ ]
如何:使用打开文件对话框 [ ^ ]
2。单击保存按钮:将PDF保存到给定路径。
保存文件对话框 [ ^ ]
如何:使用SaveFileDialog组件保存文件 [ ^ ]
3。点击关闭按钮:关闭对话框。
我不知道你的意思;(没有什么比CloseDialog。
If i understand you well, you want to call open/save dialogs via button click. Please, see:
1. Click of "Open" button: Show the PDF and give an option to save it.
OpenFileDialog[^]
How to: Use the Open File Dialog Box[^]
2. Click of "Save" button: Save the PDF to given path.
SaveFileDialog[^]
How to: Save Files Using the SaveFileDialog Component[^]
3. Click of "Close" button: Close the dialogue.
I have no idea what you mean ;( There's nothing like "CloseDialog".
>
这篇关于如何在C#中显示打开/保存/取消对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!