RichTextBox doesn't show after minimizing / restoring

A

ajou_king

I have a richtextbox that is used to update with information. That
works.

public void addTextIn(string id, string txt, Color idColor)
{
Font idFont = new Font("Arial Black", 10.0f);
Font txtFont = new Font("Verdana", 10.0f);

boxMsgIn.SelectionFont = idFont;
boxMsgIn.SelectionStart = boxMsgIn.TextLength;
boxMsgIn.SelectionColor = idColor;
boxMsgIn.SelectedText = id + " ";
boxMsgIn.SelectionColor = Color.Black;
boxMsgIn.SelectionFont = txtFont;
boxMsgIn.SelectedText = txt + Environment.NewLine;
}

However, after I minimize the whole form, and then restore - all the
contents of
the RichTextBox are gone - that were previously shown.

How do I prevent that and if text is added while the app is minimized -
how should this be done to prevent from disappearing?
 
L

Larry Lard

I have a richtextbox that is used to update with information. That
works.

public void addTextIn(string id, string txt, Color idColor)
{
Font idFont = new Font("Arial Black", 10.0f);
Font txtFont = new Font("Verdana", 10.0f);

boxMsgIn.SelectionFont = idFont;
boxMsgIn.SelectionStart = boxMsgIn.TextLength;
boxMsgIn.SelectionColor = idColor;
boxMsgIn.SelectedText = id + " ";
boxMsgIn.SelectionColor = Color.Black;
boxMsgIn.SelectionFont = txtFont;
boxMsgIn.SelectedText = txt + Environment.NewLine;
}

However, after I minimize the whole form, and then restore - all the
contents of
the RichTextBox are gone - that were previously shown.

How do I prevent that and if text is added while the app is minimized -
how should this be done to prevent from disappearing?

Well, there doesn't seem to be anything wrong with that particular
snippet. Perhaps you could post a short but complete program that shows
the problem? By that I mean what it says here:
<http://www.yoda.arachsys.com/csharp/complete.html>
 
Top