我这里有一个情况。我需要在Windows表单中使用C#在Visual Studio 2010中创建员工卡结构。该结构可能包含具有白色背景的标签和图片框。我创建它没有问题,但我也在这个表单上放了一个名为“打印”的按钮,以便用户可以打印那张卡片。我谷歌了一下,但没有找到任何具体的东西。请帮忙解决。
namespace Employee_Card_Manager
{
public partial class Card : Form
{
public Card(String a, String b, String c, String d, String e, String f, String g, String h, String i)
{
InitializeComponent();
this.label2.Text = a;
this.label9.Text = b;
this.label10.Text = c;
this.label11.Text = d;
this.label12.Text = e;
this.label13.Text = f;
this.label14.Text = g;
this.label16.Text = h;
this.pictureBox1.Image = Image.FromFile(i);
Image myimg = Code128Rendering.MakeBarcodeImage(h, 2, true);
this.pictureBox2.Image = myimg;
}
private void button1_Click(object sender, EventArgs e)
{
//Print Card Code
}
}
}
卡片模板如下所示: