Line spacing in winform RichTextBox

I use a RichTextBox control in my winform project to display my old console screen. This works fine, but there is a space between the lines. Is it possible to change this space to 0 or something next to it. If I draw a line from a poetic line from line 1 to line 5, I do not want any gap between the line.

I hope you help me.

+3
source share
1 answer

Actually there is a lot that Windows Forms RichTextBox does not reveal. If you have an HWND (Handle) property for the control, you can use the SendMessage API to send the EM_SETPARAFORMAT message for formatted playback.

In particular, the PARAFORMAT2 structure has some line spacing parameters that may be relevant. You will need to get your hands dirty with interop though.

+3
source

Source: https://habr.com/ru/post/1751337/


All Articles