Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (9 votes)
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

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.
 
Share this answer
 
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.
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.
 
Share this answer
 
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][^]
 
Share this answer
 
v2
You can think like this.RichtextBox = Word (Open,Save {RTF,TXT,Images,Fonts etc})
TextBox = INPUT (Just Text Or Number)
 
Share this answer
 
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...
 
Share this answer
 
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.
 
Share this answer
 
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.
 
Share this answer
 
v2
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.
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900