试图在C#2008中打印出富文本框的文本 [英] Trying to print out a Rich Text Box's text in C# 2008

查看:187
本文介绍了试图在C#2008中打印出富文本框的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

基本问题我在尝试打印一个程序打印出富文本框的内容时遇到了困难,我在2003年做过这样的事情.Net 1.0从未在网络中有过需要2.0(直到现在)

我已将Print Dialog拖到表单上,

Hi All,
Basic question I am having difficulties trying to get a program to print out the contents of a Rich Text Box, I have done this in 2003 Net 1.0 never had the need in Net 2.0 (until now)
I have dragged the Print Dialog to the form,

MessageBox.Show("here!");
PrintDialog pd = new PrintDialog();
PrinterSettings ps = new PrinterSettings();
DialogResult dr = pd.ShowDialog();
pd.PrinterSettings = ps;
pd.UseEXDialog = true;
pd.ShowDialog();

if (dr == DialogResult.OK)
{

}



输入上面的代码来显示对话框,它没有,现在我很困惑。因为它没有错误或做任何事情???

似乎有很多例子可以绕过对话框,但缺少这个是你如何做的。

Glenn


Enter the above code to get the Dialog to appear, it doesn't and now I am confused. As it does not error or do anything???
There seem to be lots of examples for getting around the dialog, but a lack of this is how you do it.
Glenn

推荐答案

尝试添加以下行:

Try adding this line:
pd.UseEXDialog = true; 


感谢Marc Gabrie和其他我已经解决了这个问题我使用了错误的组件我应该使用printDocument来实际打印出来,那个令人费解的男人!

格伦
Hi, thanks to Marc Gabrie and other I have solved this I was using the wrong component I should have been using the printDocument to actually get the print out wanted, man that was puzzling!
Glenn


这篇关于试图在C#2008中打印出富文本框的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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