Code:
基类XMarksTheSpot(支持打印):
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Printing;
using System.Drawing.Drawing2D;
namespace CsStudy
{
class XMarksTheSpot : Form
{
public static void Main()
{
Application.Run(new XMarksTheSpot());
}
public XMarksTheSpot()
{
Text = this.Name;
ResizeRedraw = true;
}
protected override void OnPaint(PaintEventArgs e)
{
DoPage(e.Graphics, ForeColor, ClientSize.Width, ClientSize.Height);
base.OnPaint(e);
}
protected override void OnClick(EventArgs e)
{
PrintDocument prndoc = new PrintDocument();
prndoc.DocumentName = Text;