
It's simple snippets like this that take the guess work out of coding, and I appreciate your posting it somewhere so publicly available. I had to come back and edit this after reading everyone elses comments. The following code snippet explains to us how to do the multiple colored texts in textbox. You can change the colors as per your wish by changing the codebehind. One is for red colored text and the other is for green colored text. You can download the attached sample application and try to see the magic by clicking the buttons. I have given the code snippet with this article. I just tried to create it as a sample application and it is done. Setting the values for these properties makes multiple colors in our richtextbox. Richtextbox has the properties of SelectionFont, SelectionColor and SelectedText. There is a property to set colored text by using SelectionText. Then I tried in Google and found that we have an option to do it in richtextbox. I just tried to find any other way to have multiple colors in a textbox, unfortunately did not find one. PrerequisitesĪctually one of my colleagues asked me how to enter values in a richtextbox with multiple color texts.

By using the SelectionText property in richtextbox we have created a sample application for multiple colored texts in Microsoft’s richtextbox control. This Channel 9 video gives an in-depth description of how to use the Editor.This article is created for making multiple colored texts in a textbox.

To download and install just the extended themes without the editor, check out the Color Themes Github Project. Allows users to customize the Visual Studio 2017 color palette.įor Visual Studio 2019, use the updated extension.
