Difference between text box and RichTextbox wpf?

The text box and RichTextbox look the same. But I donโ€™t know the difference. Please tell me someone. When I need to use TextBox and RichTextbox, as well as in wpf.

+7
source share
3 answers

See Microsoft's overview of the differences between TextBox and RichTextBox.

Top Link:

Both RichTextBox and TextBox allow users to edit text, however, two controls are used in different scenarios. RichTextBox is the best choice when the user needs to edit formatted text, images, tables or other rich content. For example, editing a document, article, or blog that requires formatting, images, etc., is best used with RichTextBox. A TextBox requires less system resources and then a RichTextBox, and this is ideal when you need to edit only plain text (i.e. Use in forms).

+7
source

A RichTextBox is mainly used if you want more control over the styling of text, type, font, alignment, etc. So, all that you can do in Microsoft Word, you can do with RichTextBox. It can be used to save or display .rtf files with ease.

A The text box is mainly used to display or enter one string input. You may have a multi-line TextBox, which is mainly used to display or retrieve multiple single-line images and prevents you from managing multiple text blocks. In addition, your user interface is a bit neat.

Thus, the main difference is stylization. If you just want something simple and simple, use a TextBox. If you want something fantastic, for example, styles, colors use RichTextBox.

Look at this:

+1
source

Much has been said about the differences in the use of controls.

An important technical difference is that the TextBox supports DataBinding, the RichTextBox does not, which makes it somewhat unpleasant for use in an MVVM application. If you want to use RichTextBox with DataBinding capabilities, check out the extended WPF Toolkit on CodePlex.

0
source

All Articles