Click here to Skip to main content
14,638,468 members
Rate this:
Please Sign up or sign in to vote.
See more:
Difference between textbox and richtextbox
Posted
Updated 27-Aug-20 10:00am
Comments
NuttingCDEF 4-May-11 2:36am
   
Agreed - yes, there is a difference. Anyone care to offer a contrary opinion?
Did you have a question about them? If so, what was it?
Manfred Rudolf Bihy 4-May-11 6:16am
   
I'd 5 that if I only could!
Smithers-Jones 4-May-11 7:08am
   
Too lazy to phrase a complete sentence, too lazy to use Google
Rate this:
Please Sign up or sign in to vote.

Solution 8

Here are Some Difference Between Textbox and RichTextBox :
==========================================================

A RichTextBox is a better choice when it is necessary for the user 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 accomplished using a RichTextBox.

A TextBox requires less system resources then a RichTextBox and it is ideal when only plain text needs to be edited (i.e. usage in forms).

A RichTextBox mainly used if you want more control over styling the text color, type, font, alignment ect. So anything you can do in Microsoft Word, you can do with a RichTextBox. It can be used to save or display .rtf files with ease.

A Textbox is basically used to display or get one line input. You can have a multi-line TextBox which is used mainly to display or get more than one one-liner and keeps you from having to manage multiple TextBox's. Also keeps your UI a little more tidy.

An important technical difference is that TextBox supports DataBinding, RichTextBox does not, which makes it a bit nasty to use in an MVVM application.
   
Comments
anurag19289 28-Oct-13 7:12am
   
good1
Clivic TR 21-Dec-16 9:53am
   
Hi. According to MSDN the property DataBinding is inherited from Control. So both of RichTextbox and Textbox should support DataBinding.
Rate this:
Please Sign up or sign in to vote.

Solution 2

The text box displays plain ASCII or Unicode text.

The Rich Text Box displays Rich Text Format text - which allows many of the formatting possibilities supported by word processors - different typefaces, tables, etc. This is useful if it can be treated opaquely, but you rarely want to be doing textual manipulation of Rich Text, as its horrible.

On the other hand, many tools such as programmers editors use the RichTextBox, as it allows the developer to support options like syntax colouring.
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

A simple TextBox can display text without or less formatting
On the other hand, RichTextBox facilitatets us to format different parts of text differently
for more details go there-[What's the difference between Rich Text Boxes and Normal Text Boxes][^]
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 3

You can think like this.RichtextBox = Word (Open,Save {RTF,TXT,Images,Fonts etc})
TextBox = INPUT (Just Text Or Number)
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

Apart from the name? :rolleyes:

TextBox can only show ascii chars without special formats and RichTextBox can show the same with special formats applied: bold, italics, font sizes, colors...
   
Rate this:
Please Sign up or sign in to vote.

Solution 5

There are quite a few differences..

Lets first talk about what they do and then you can see the difference.
TextBox:
In a nut shell, It is basically use to display or get one liner input. You can have a multi-line TextBox which is used mainly to display or get more than one one-liner and keeps you from having to manage multiple TextBox's. Also keeps your UI a little more tidy.

RichTextBox:
This is mainly used if you want a story type response or to display something of the like. You have more control over styling the text color, type, font, alignment ect... Basically anything you can do in Microsoft Word, you can do with a RichTextBox. It is also used to save or display .rtf files with ease.

If you want a user to input their name then use a TextBox. If you want the user to input what they did for the day, use a RichTextBox.
   
Rate this:
Please Sign up or sign in to vote.

Solution 6

richtextbox allows you to format text, open RTF formatted documents and view them as well as saving into those formats. Textboxts you cant really format them, its just only one font or 1 color or whatever, with an RTB you can format selected text or color certain text, change the font of text etc....

http://msdn2.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx

its more advanced than a plain simple textbox. you can also tell it to detect url links automatically, a textbox doesn't do this. It's pretty much just like wordpad, if you have used it in Windows. You can create an entire rich text editor using the richtextbox control.

you can select text, insert images, change fonts, change colors, load and save richtext formats or plain text formats - you can't do it with a textbox except for the fonts but even then you can only have 1 font applied to on a textbox. You can also I believe find text in the richtextbox and a textbox does not have this feature.
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 7

A simple TextBox can display text without or less formatting i.e it can display all of its Text in same formatiing. Like Bold, Italic Uderline or combination. You can give it fore color and also change font. That's it!

On the other hand, RichTextBox facilitatets us to format different parts of text differently. Like 1 Area of text is bold other is normal while another is Bold + Italic+ Underline. You can alo put bullets in RichtextBox, Also set Fore and Background color of text. Also RichTextBox can display tables while Textbox can't. So there are many scenerios where you do need this type of formatting and a simple TextBox is of no use.

Exact examples of these 2 are Notepad (TextBox) and Wordpad (RichTextBox).

Open both the applications and play with different options. You'll know what is possible with RichtextBox which cant be done with TextBox.
   
Comments
akchandra9 13-Sep-12 10:23am
   
^good one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100