日期:2014-05-18  浏览次数:20905 次

C#打印字符串
如题,有一字符串 string str="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
怎么将其打印出来~ 谢谢了~

------解决方案--------------------
用printPreviewDialog和printDocument控件
C# code
private void button1_Click(object sender, EventArgs e)
        {
                printPreviewDialog1.ShowDialog();
                printPreviewDialog1.Document = printDocument1;
        }
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
        {
                e.Graphics.DrawString(str, new Font("宋体", 10, FontStyle.Regular), new SolidBrush(Color.Black), 50, 160);
        }