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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With