Forum guidelines
Difference between Textbox and RichTextbox
Posted By Nithya Mohanraj on 31 Jan 2010
Hi All,

I am new to C#. What is the difference between Textbox and RichTextbox

  • 0
  • 0
Re: Difference between Textbox and RichTextbox
Posted By Nila on 31 Jan 2010  

Hi Nithya,
 Here i give a link , Go through it, i think it will help  you.
If it helps u plzz Mark it as Answer.

Re: Difference between Textbox and RichTextbox
Posted By Jacob R on 31 Jan 2010  

There are quite a few differences..
Lets first talk about what they do and then you can see the difference.
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.
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.

Re: Difference between Textbox and RichTextbox
Posted By paul daniel on 02 Feb 2010  

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).

C# Corner Annual Conference 2016


Spire.Doc - Free .NET Word API
Use Spire.Doc to create, read, write, print, and convert word documents to OpenXML, RTF, TXT, XPS, EPUB, EMF, HTML, Image and PDF.