国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

C#基本打印事件用法實例

2020-01-24 01:44:06
字體:
供稿:網(wǎng)友

本文實例講述了C#基本打印事件用法。分享給大家供大家參考。具體如下:

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication3{  public partial class Form5 : Form  {    string filename = "myfile.txt";    Font printerfont = null;    public Form5()    {      InitializeComponent();    }    private void button1_Click(object sender, EventArgs e)    {      this.printDocument1.DocumentName = this.filename;      this.printDocument1.Print();    }    private void printDocument1_BeginPrint(object sender, System.Drawing.Printing.PrintEventArgs e)    {      printerfont = new Font("Lucida Console", 72);    }    private void printDocument1_EndPrint(object sender, System.Drawing.Printing.PrintEventArgs e)    {      printerfont.Dispose();      printerfont = null;    }    private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)    {      Graphics g = e.Graphics;      g.DrawString("hello,/nPrinter", printerfont, Brushes.Black, 0, 0);    }  }}

希望本文所述對大家的C#程序設計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 靖边县| 惠来县| 县级市| 铜山县| 烟台市| 呼和浩特市| 安远县| 南汇区| 台山市| 安化县| 梅州市| 武鸣县| 铜山县| 昂仁县| 中阳县| 安西县| 临武县| 岳池县| 河北省| 江油市| 肥西县| 忻城县| 红河县| 锡林浩特市| 高唐县| 永吉县| 花垣县| 门源| 海盐县| 海林市| 綦江县| 吴川市| 太仓市| 台江县| 临安市| 柯坪县| 泰来县| 新干县| 安达市| 峨边| 扶沟县|