启用“当前页”在打印对话框中

发布于 2024-09-05 06:26:58 字数 425 浏览 3 评论 0原文

我使用 System.Windows.Controls.PrintDialog 让用户从我的应用程序打印一页或多页。这就是我目前得到的:

        PrintDialog printDialog = new PrintDialog();

        printDialog.PageRangeSelection = PageRangeSelection.AllPages;
        printDialog.UserPageRangeEnabled = true;

        if (printDialog.ShowDialog() == true)
        {
            // do print ...
        }

我正在寻找启用对话框中的当前页面单选按钮的选项。如何启用它?

Im using a System.Windows.Controls.PrintDialog to let the user print one or more pages from my application. This is what I currently got:

        PrintDialog printDialog = new PrintDialog();

        printDialog.PageRangeSelection = PageRangeSelection.AllPages;
        printDialog.UserPageRangeEnabled = true;

        if (printDialog.ShowDialog() == true)
        {
            // do print ...
        }

Im looking for the option to enable the Current Page radio button in the dialog. How to enable it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆萌少年 2024-09-12 06:26:58

如果您通过 Reflector 反编译引用 PresentationFramework.dll,您将能够看到该类与 CurrentPage 没有任何关系。我认为这个单选按钮在 Win32PrintDialog 中默认被禁用。在 WinForms 中,这个单选按钮默认情况下肯定是禁用的:

    [DefaultValue(false), SRDescription(SR.PDallowCurrentPageDescr)] 
    public bool AllowCurrentPage {
        get { return allowCurrentPage;}
        set { allowCurrentPage = value;}
    } 

我想你不能启用这个单选按钮,但我可能是错的。

If you will decompile reference PresentationFramework.dll by Reflector you would be able to see that this class have nothing about CurrentPage. I think this radiobutton is disabled by default in Win32PrintDialog. In WinForms this radiobutton definitely is disabled by default:

    [DefaultValue(false), SRDescription(SR.PDallowCurrentPageDescr)] 
    public bool AllowCurrentPage {
        get { return allowCurrentPage;}
        set { allowCurrentPage = value;}
    } 

I suppose that you can't enable this radiobutton, but I can be mistaken.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文