📄 print.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Printing;
namespace FOUPOS
{
public partial class Print : Form
{
public Print()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//打印图像
//显示打印设置对话框
PrintDialog MySettings = new PrintDialog();
MySettings.Document = this.printDocument1;
PaperSize p = null;
foreach (PaperSize ps in MySettings.Document.PrinterSettings.PaperSizes)
{
if (ps.PaperName.Equals("A2"))//这里设置纸张大小,但必须是定义好的
p = ps;
}
MySettings.Document.DefaultPageSettings.PaperSize = p;
if (MySettings.ShowDialog() == DialogResult.OK)
{
this.printDocument1.Print();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -