C# Printing (RichTextBox)

后端 未结 4 2022
我在风中等你
我在风中等你 2020-12-01 16:57

I want to print the content of my RichTextBox (eintragRichTextBox) I have now this code:

private void druckenPictureBox_Click(object sender, EventArgs e)
{
          


        
4条回答
  •  粉色の甜心
    2020-12-01 17:28

    use that!

    StringReader reader;
            int prov = 0;
    
            private void DocumentToPrint_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
            {
    
    
                if (prov == 0)
                {
                    prov = 1;
                    reader = new StringReader(eintragRichTextBox.Text);
                }
    float LinesPerPage = 0;
                float YPosition = 0;
                int Count = 0;
                float LeftMargin = e.MarginBounds.Left;
                float TopMargin = e.MarginBounds.Top;
                string Line = null;
    

    ....

提交回复
热议问题