---
title: "Multi-color TextBox C#"  
description: "Multi-color TextBox C#"  
author: "Mark Devid"  
published: 2013-11-14  
updated: 2013-11-14  
canonical: https://www.mindstick.com/forum/1727/multi-color-textbox-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Multi-color TextBox C#

I want show [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) in [textbox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) in 2 [colors](https://answers.mindstick.com/qa/31019/should-i-paint-my-interior-with-neutral-or-bright-colors), for example 1 line [red](https://yourviews.mindstick.com/view/81343/lonar-lake-turning-red-again) 2 [blue](https://www.mindstick.com/news/2545/for-apple-users-twitter-will-relaunch-twitter-blue-at-a-higher-price), if I use name.ForeColor = [Color](https://www.mindstick.com/articles/77/how-to-split-form-background-color-in-c-sharp).Red; all text change color, but I want that will change only 1 line color.

## Replies

### Reply by Pravesh Singh

Use a RichTextBox for this:

```
public static class RichTextBoxExtensions{    public static void AppendText(this RichTextBox box, string text, Color color)    {       
box.SelectionStart = box.TextLength;       
box.SelectionLength = 0;       
box.SelectionColor = color;       
box.AppendText(text);       
box.SelectionColor = box.ForeColor;    }}
```


---

Original Source: https://www.mindstick.com/forum/1727/multi-color-textbox-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
