|I am having a RichTextBox in a Canvas, or perhaps it should be an Adorner.
The thing is, this RichTextBox has no witdh (min,max, current, whatever) set nor has any hint about which width to use, like so:
<RichTextBox Canvas.Top="50" Canvas.Left="80">
I was hoping it would auto resize when text is edited. But the thing is, the width is set to and doesn't update. And It ends-up wordwrapping on every letter like so!
Hence I am currently investigating.. how to make a WPF RichTextBox auto size! And would appreciate any help!
I am aware this goes against the design and implementation of
RichTextBox, and also some people seem obsessed with my use of
Canvas in the example above.
At any rate I gave up for now, but I asked here in just in case there is a work around solution somewhere on the internet that any one knows about?
Meanwhile, to temper the obsessive questioning about why I used a
Canvas (not really but it's a good approximation) or why I "need resizable text" here is my use case.
Forget about LOB applications. Imagine there is a (zoomable, scrollable, pannable, rotatable) drawing area.
Now when the user click somewhere multiple things could happen (like, say, drawing a bezier curve), one of them is adding some text centered around said point. Which start by typing said text centered at point inline, ie. wysiwig editing. With the box around the text, previewing textblock handles, for later manipulation, such as rotation or translation (as in displacement)
modified 15-Dec-21 7:43am.