Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021)

This post introduces the new Texts in Shapes feature in WPF RadRichTextBox and describes how you can add text to shapes.


This content originally appeared on Telerik Blogs and was authored by Dimitar Karamfilov

This post introduces the new Texts in Shapes feature in WPF RadRichTextBox and describes how you can add text to shapes.

In R2 2021 we introduced support for shapes, which was one of the most-demanded features in the RadRichTextBox. You can find more information about this in the following blog post: Shapes and DrawingML Are Now Supported in RadRichTextBox.

Now, with R3 2021, the end user can add text to the shapes and apply different styling options to it.

blog_shapes_1 - A blue rectangle gets text that is turned vertical

Adding Text to Shapes

Adding text to an existing shape is easy and straightforward. You can start typing directly or use the context menu.

blog_shapes_2 - a blue rectangle is added. Right-click menu option 'Add text' allows user to type in it.

Features in the Format Shape Pane

  • Vertical alignment: The supported values are Top, Center and Bottom.
  • Text direction: The supported values are Horizontal, Degrees90 and Degrees270.
  • Do not rotate text: This feature allows you to rotate the shape while text remains in the same position or to rotate the text along with the shape.
  • Resize text with shape: Default value is false, and the shape height is stretched to fit the text inside it.
  • Margins: You can set the top, right, left and bottom margins separately in the Format Shape pane.
  • Wrap text in shape: Default value is true, and the text is split in lines to fit the shape horizontally. If set to false, the shape width is adjusted to the widest line of text.

blog_shapes_3 - the above features are demonstrated

Setting Text Fill and Outline

The second tab allows you to set the shape fill and outline properties. You can choose from various solid and gradient lines and fills.

blog_shapes_5 - fill changed from solid to gradient. Type gradients changed, transparency adjusted.

Setting Other Text Properties

You can set other properties by selecting the text in the shape (the caret must be in the shape as well) and then going to the Home tab and setting properties there.

You can set properties like alignment, background color, fore color, font family, font size and others. Essentially, the shape contains another RadRichTextBox inside it which allows you to style text as in a normal RadRichTextBox and add extra elements.

blog_shapes_4 - text adjusted color, alignment, font

Try It and Share Your Feedback

In case you still haven’t tried Telerik UI for WPF and RadRichTextBox, use the button below to obtain a trial version and explore all the features and possibilities of the libraries.

Download a Free Trial

If you are already familiar with the package, don’t forget that we are eager to hear your feedback and would be very happy to hear any ideas and recommendations you might have. Feel free to drop us a comment below sharing your thoughts. Or visit the Telerik UI for WPF, and Document Processing Libraries dedicated Feedback Portals and let us know if you have any suggestions or if you need any specific features and controls.


This content originally appeared on Telerik Blogs and was authored by Dimitar Karamfilov


Print Share Comment Cite Upload Translate Updates
APA

Dimitar Karamfilov | Sciencx (2021-11-05T08:15:00+00:00) Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021). Retrieved from https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/

MLA
" » Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021)." Dimitar Karamfilov | Sciencx - Friday November 5, 2021, https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/
HARVARD
Dimitar Karamfilov | Sciencx Friday November 5, 2021 » Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021)., viewed ,<https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/>
VANCOUVER
Dimitar Karamfilov | Sciencx - » Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/
CHICAGO
" » Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021)." Dimitar Karamfilov | Sciencx - Accessed . https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/
IEEE
" » Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021)." Dimitar Karamfilov | Sciencx [Online]. Available: https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/. [Accessed: ]
rf:citation
» Now You Can Add Text to Shapes in WPF RadRichTextBox (R3 2021) | Dimitar Karamfilov | Sciencx | https://www.scien.cx/2021/11/05/now-you-can-add-text-to-shapes-in-wpf-radrichtextbox-r3-2021/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.