I don't mean the control's .Height property...
...I have a WinForm with a RichTextBox control, and another control underneath the RichTextBox control. The RichTextBox control is anchored on the left, top, and right sides, so the width is automatically resized as the parent form is resized.
(it also has its Multiline and and WordWrap properties set to True)
The item underneath the RichTextBox needs to always be right underneath it (little whitespace), and the RichTextBox needs to always display its entire text (nothing hidden).
As I get the form's resize event, I'd like to update the RichTextBox's hight so all text is displayed, however I'm not seeing any properities or methods which would be helpful. There is the PrefferredHeight property, but it is always returning 13.
Basically, it comes dowen to this: when WordWrap is set to true, is there a way to see what the desired height is? Or is there a way to see if any of the text is clipped?
If not, I suppose my next step would be to roll my own custom control and draw the text myself, keeping track of the autowrap and line count, but I thought I'd post a message here first and see if anyone has a better idea.
View Complete Post