void Document_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) 
{ 
   int itar=0; 
   foreach (char c in this.richTextBox.Text) 
   { 
      if (c != '\n') 
      { 
         this.richTextBox.Select(itar, 1); 
         Point point = this.richTextBox.GetPositionFromCharIndex(itar); 
         e.Graphics.DrawString(c.ToString(), this.richTextBox.SelectionFont, new SolidBrush(this.richTextBox.SelectionColor), point); 
      } 
      itar++; 
   } 
}  

 

+ Recent posts