.NET - Long Line in RichTextBox Wrapped after 3,510 Characters

前端 未结 1 1787
无人及你
无人及你 2021-01-05 09:10

I have a RichTextBox in a WInForms program that is wrapping any line that is longer than 3,510 characters. I have WordWrap set to false, so all lines under that length exte

相关标签:
1条回答
  • 2021-01-05 09:34

    You could set the rightmargin of the richTextBox to the width of the string? Like this

    richTextBox1.RightMargin = 
    TextRenderer.MeasureText(sb.ToString(), this.richTextBox1.Font).Width;
    
    0 讨论(0)
提交回复
热议问题