a_jam_sandwich
Well-known member
Help adapted C not working for RTB printing
Complies. Put on form & error;
the user control could not be loaded. Ensure that the library containing the control has been built ...
Complies. Put on form & error;
the user control could not be loaded. Ensure that the library containing the control has been built ...
C#:
namespace de.cortex.text.util
{
using System;
using System.Drawing.Printing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
// <doc>
// <desc>
// RichTextPrintDocument prints the content of a RichTextBox
// control as RTF formatted text to a printer.
//
// Usage:
// RichTextBox rtb = new RichTextBox();
// ... define content of rich text box control
// RichTextPrintDocument pd = new RichTextPrintDocument(rtb);
// ... define default page settings
// ... show standard or custom print dialog
// if (dlgResult == DialogResult.OK)
// pd.Print();
// </desc>
// </doc>
public class RichTextPrintDocument : PrintDocument
{
// internal data structures needed for EM_FORMATRANGE message
// send to RichTextBox control windows handle via SendMessage()
// The windows message handling is based on code posted by
// Martin M