Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have differently colored lines in multiline text box?

Is it possible to have differently colored lines in multiline text box?

I'm adding data to the text box and I want to clarify for the user different types of text by color.

How to do this if it's possible?

like image 250
HelpNeeder Avatar asked Jan 22 '12 00:01

HelpNeeder


People also ask

Can a TextBox have multiple lines?

With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In TextBox, you are allowed to create a multiline TextBox which stores multiple lines of the content using Multiline property of the TextBox.

How do I change the line in a text box?

Select the text box or shape. On the Format tab, click Shape Outline, point to Dashes, and then select More Lines. In the Format Shape pane, under Line, select the line style options that you want.

What is a multi line text box?

A multiline text box control is a large text box that can display several lines of text or accept this text from user input. Text boxes are often linked to select value lookups and detailed menus. You can place a multiline text box control within a section control.


2 Answers

You can do this if you use a RichTextBox control. See the documentation here (particularly look at the Remarks and Examples sections). The standard TextBox does not offer this capability.

like image 184
Brian Rogers Avatar answered Nov 13 '22 08:11

Brian Rogers


The standard Winforms textbox does not have this ability (and adding it would be troublesome).

You could look at using the System.Windows.Forms.RichTextBox as an alternative for this or one of the many commercial alternatives.

like image 32
M.Babcock Avatar answered Nov 13 '22 06:11

M.Babcock