Word-Wrap Fire Event

Is there a way to find out when text is wrapped (WordWrap) inside a RichTextBox? I dug a little, but did not find anything, will continue to look, though ...

I consider this because I need the event to fire whenever a RichTextBox wraps text at the end of a line.

Thank you all

+3
source share
1 answer

Technically, I believe this is possible using the Windows API. Take a look at EM_SETHYPHENATEINFO and, in particular, the ability to pass custom HyphenateProc. This is a pointer to a function that is called when a rich text text field needs to wrap a string and calls your function to determine how to wrap a word.

Having said that, I sincerely doubt that this manifests itself in .NET, so you will need to delve into the API a bit. But I think this would be the best way to get a wrapper notification of each line.

UPDATE
Here you go, I found a blog post that says a little more about it.

+2
source

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


All Articles