Textbox looses forecolor on disabling it : <p>I dynamically create multiple textboxes for showing information to the user. Now I want to set the back- and forecolor of some textboxes if a statement is true.</p>

<p>All this works just fine, untill I disable the textbox, now the forecolor "resets" to the standart color instead of showing my desired one.</p>

<pre><code>DataTable dt = [some data]
//Col 0: ID
//Col 1: some text
//Col 2: date

for (int i = 0; i &lt; dt.Rows.Count; i++)
{

    DateTime d = (DateTime) dt.Rows[i].ItemArray[2];
    TextBox txt = new TextBox();
    txt.Multiline = true;
    txt.Font = tb_Aufloesung.Font;
    txt.Text = dt.Rows[i].ItemArray[1].ToString() + "\n" + d.ToString(@"dd.MM.yyyy");
    txt.Size = new Size((TextRenderer.MeasureText(dt.Rows[i].ItemArray[1].ToString(), txt.Font).Width) + 10, 34);
    txt.Location = new Point(43, 3 + split.Panel2.Controls.Count / 2 * 40);

    if(d &lt;= DateTime.Now) {
        txt.BackColor = Color.Red;
        txt.ForeColor = Color.White;
    }    

    //txt.Enabled = false;

    split.Panel2.Controls.Add(txt);
}
</code></pre>

<p>This is how the Textboxes look when I use the code above with :</p>

<ol>
<li>comment the line   -> <code>//txt.Enabled = false;</code></li>
<li>uncomment the line -> <code>txt.Enabled = false;</code></li>
</ol>

<p><a href="https://i.stack.imgur.com/0hfkS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0hfkS.png" alt="enter image description here"></a></p>

<p>I have no idea why in the second case, the forecolor of the red textbox is not white as it should be.
Anyone any idea?</p>
