---
title: "How do I change the text color of a rich text box that is is an MDI Parent Form?"  
description: "How do I change the text color of a rich text box that is is an MDI Parent Form?"  
author: "Anonymous User"  
published: 2013-09-23  
updated: 2013-09-23  
canonical: https://www.mindstick.com/forum/1482/how-do-i-change-the-text-color-of-a-rich-text-box-that-is-is-an-mdi-parent-form  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# How do I change the text color of a rich text box that is is an MDI Parent Form?

I have Form1, which is an [MDI](https://answers.mindstick.com/qa/92557/what-are-mdi-and-sdi) [form](https://www.mindstick.com/forum/6/multi-form-mfc-application). In Form2 (ChildForm) I have a [rich text](https://www.mindstick.com/forum/33836/how-to-use-rich-text-box-editor-in-web-page) box.

I have a menu strip that contains a "[Format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format)" option. Under this I have font, [size](https://www.mindstick.com/forum/159799/how-can-you-manage-the-size-of-mdf-and-ldf-files), and [color](https://www.mindstick.com/articles/77/how-to-split-form-background-color-in-c-sharp). Changing the font and size through the Font [method](https://www.mindstick.com/forum/166/webservice-method) was easy, but color seems to be a different story.

I also am not able to directly call on the rich text box since it is in the child form, and a new child form isn't being created upon the color change.

```
//when Black is clicked in Color/Formatprivate void blackToolStripMenuItem_Click(object sender, EventArgs e){    //change color to black}//when Red is clicked in Color/Formatprivate void redToolStripMenuItem_Click(object sender, EventArgs e){    //change color to red}
```

## Replies

### Reply by Sumit Kesarwani

Hi JayPrakash,

If you want to work with the controls in the child form you can use the Controls collection and refer to the richTextBox using the name of the control. For example if I have a richTextBox named richTextBox1 I can use the following code to refer from the MDI parent:

ActiveMdiChild.Controls["richTextBox1"].ForeColor = Color.Blue;

For your bonus question I was wondering if you tried the AutoSize property in the child and set it up to False.


---

Original Source: https://www.mindstick.com/forum/1482/how-do-i-change-the-text-color-of-a-rich-text-box-that-is-is-an-mdi-parent-form

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
