我现在在做一个银行打印单据
但是我打印不了 textbox控件里面的值 .
不知道那个代码怎么写
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace printer
{
public partial class nonghang_chu_kuan_chu_tiao : Form
{
public nonghang_chu_kuan_chu_tiao()
{
InitializeComponent();
} private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
string name = textBox1.Text;
string sex = textBox2.Text;
string[] sh = new string[2]{name,sex};
} private void nonghang_chu_kuan_chu_tiao_Load(object sender, EventArgs e)
{ } private void button1_Click(object sender, EventArgs e)
{
PrintDialog pd = new PrintDialog();
pd.Document = printDocument1;
if (printDialog1.ShowDialog() != DialogResult.Cancel) {
try
{
printDocument1.Print();
}
catch(Exception ex) {
MessageBox.Show(ex.Message);
}
}
}
}
}
下面有个窗体的图 想用一个数组调进printDocument 里面去.到最后实在写不下去了
各位帮帮我吧. 谢谢了
但是我打印不了 textbox控件里面的值 .
不知道那个代码怎么写
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace printer
{
public partial class nonghang_chu_kuan_chu_tiao : Form
{
public nonghang_chu_kuan_chu_tiao()
{
InitializeComponent();
} private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
string name = textBox1.Text;
string sex = textBox2.Text;
string[] sh = new string[2]{name,sex};
} private void nonghang_chu_kuan_chu_tiao_Load(object sender, EventArgs e)
{ } private void button1_Click(object sender, EventArgs e)
{
PrintDialog pd = new PrintDialog();
pd.Document = printDocument1;
if (printDialog1.ShowDialog() != DialogResult.Cancel) {
try
{
printDocument1.Print();
}
catch(Exception ex) {
MessageBox.Show(ex.Message);
}
}
}
}
}
下面有个窗体的图 想用一个数组调进printDocument 里面去.到最后实在写不下去了
各位帮帮我吧. 谢谢了
解决方案 »
- 求助 如何设置一个线程在一个制定周期内的指定时间实现方法
- 请教一下Entity1.Where("xxx").Take(1).Single()如何用反射的方法执行?
- TreeNodeCollection数据类型的问题
- 二进制文件 读写 第一次写长度为 20 第二次 写长度 18 读出来还是 长度20 的 为什么不是覆盖的写
- C#画线的问题
- 使用强类型DataSet数据实体,如何建立各层间对数据实体的实现或访问接口,实现松藕合的最佳折衷方案
- 大家看看一个小问题 帮我这新手一个忙
- C# 服务的依赖关系,请大神帮忙解答一下
- 菜鸟求教:这个控件是什么(报表控件?gridview?)
- 求一段正则,JSON中的双引号处理
- C# winfrom 提交数据 post
- 在线等连接数据库问题
{
Font printFont = this.textBox.Font; //当前的打印字体
SolidBrush myBrush = new SolidBrush(Color.Black);
e.Graphics.DrawString("",...
}