coloured lines in a multilined textbox
-
hi friends. i am facing a problem.:( i want to display some text in a multilined texebox. actually its a text box, displaying some status. I want to show different color text for some perticular status. i tried using the color property of the textbox, but it changes the color of the entire box. please help.
-
hi friends. i am facing a problem.:( i want to display some text in a multilined texebox. actually its a text box, displaying some status. I want to show different color text for some perticular status. i tried using the color property of the textbox, but it changes the color of the entire box. please help.
Get a textbox that supports multiple colours. Either that, or I remember doing this years back in vb4 (with extras) using subclassing to do the job. If i remember rightly i trapped the paint event, got the position for the line i wanted to colour etc and printed the new coloured text directly over the exiting one in the listbox. This worked surprisingly well especially since I only did it to piss off a mate who said making colour listboxes was the only thing he couldn't do :-)
-
hi friends. i am facing a problem.:( i want to display some text in a multilined texebox. actually its a text box, displaying some status. I want to show different color text for some perticular status. i tried using the color property of the textbox, but it changes the color of the entire box. please help.
Have a look at the RichTextBox control coming with the framework.
-
Have a look at the RichTextBox control coming with the framework.
how is rich text box different from the normal one? what properties of the rich text box can i use?
-
how is rich text box different from the normal one? what properties of the rich text box can i use?
The RichTextBox can display documents in rtf format. Create a Word document, save it as rtf and load it into the richtextbox and youll see that it is rathe rpowerful. To understand how the text must be build to make certain formattings or colors I would suggest that you make samples of what you try to achieve in word and then look into the Rtf property. To just change the color (and also some other properties) of specific words or lines the following way is the easiest: 1. Call the Select method to select some part of the displayed text. 2. Set the SelectionColor property to change the color of the selected text.