我在网上下了个打印程序,如下 
     protected void Button1_Click(object sender, EventArgs e)
    {
        PrintDocument printDocument;
        printDocument = new PrintDocument();
        printDocument.PrintPage += new PrintPageEventHandler(this.printDocument_PrintPage); 
    }
    private void printDocument_PrintPage(object sender,PrintPageEventArgs e) 
  { 
  Graphics g = e.Graphics; //获得绘图对象 
  float linesPerPage = 0; //页面的行号 
  float yPosition = 0; //绘制字符串的纵向位置 
  int count = 0; //行计数器 
  float leftMargin = e.MarginBounds.Left; //左边距 
  float topMargin = e.MarginBounds.Top; //上边距 
  string line = null; 行字符串 
  Font PrintFont = this.textBox.Font; //当前的打印字体 
  SolidBrush myBrush = new SolidBrush(Color.Black);//刷子 
  linesPerPage = e.MarginBounds.Height / printFont.GetHeight(g);//每页可打印的行数 
  //逐行的循环打印一页 
  while(count < linesPerPage && ((line=lineReader.ReadLine()) != null)) 
  { 
  yPosition = topMargin + (count * printFont.GetHeight(g)); 
  g.DrawString(line, printFont, myBrush, leftMargin, yPosition, new StringFormat()); 
  count++; 
  }
    }
在调试时总出错
Font PrintFont = this.textBox.Font;这一行应输入;谁能帮忙看下吗,能否给我解释下这个程序啊,谢谢