获取打印对话框的结果
Get the result of a PrintDialog
好的,在我的程序中,我显示了一个printDialog,我希望能够知道用户是单击打印按钮还是取消按钮。在我看到的所有在线示例中,printDialog都有确定按钮,而不是打印按钮。
例如(来自 msdn 的代码):
System::Windows::Forms::DialogResult result = printDialog1->ShowDialog();
if ( result == ::DialogResult::OK )
{
//printing code here
}
因此,如果没有确定按钮,显然此代码将无法正常工作。
有人知道如何判断是否单击了打印按钮吗?
"打印"按钮返回DialogResult::OK
因此可以安全地检查该值。
事实上,从 CommonDialog 继承的任何对话框都将返回 OK 表示成功。
相关文章:
- 如何在Qbutton的帮助下更改Q对话框的宽度
- 当对话框被接受时,如何用参数调用槽
- WinAPI 在单击第一个对话框上的按钮控件并销毁第一个对话框后创建第二个对话框
- 如何多次询问来自QML对话框的输入?
- 选择文件对话框错误
- 自定义对话框(源自QDialog)不会关闭(Android)
- 如何在 MFC 对话框中使用 OnDraw
- 在C++中创建文件夹选取器对话框的最简单方法是什么?
- 从资源视图访问对话框时出现问题
- 如何检测窗口当前是否正在运行模式对话框?
- "最小化"按钮不会出现在 MFC 对话框中
- 如何获取QNetworkConfiguration UserChoice对话框?
- 表单显示对话框函数错误,并且不执行下面的语句
- 如何在 VC6 中的对话框中将图标设置为按钮
- C++/Win32 构造函数不使用从对话框获取的字符串初始化变量
- 在 Win32 应用中,如果未选择文件夹并且用户单击"确定",则文件夹选择对话框将关闭
- 在主窗口之前显示登录对话框并隐藏主窗口按钮
- 找不到没有具有类名 #32770 的窗口名称的父窗口的子窗口(对话框)
- 如何在主窗口标签的对话框中显示QLineEdit的输入
- 获取打印对话框的结果