It would be best to have both a Label
and a TextBox
in the same location.
Hide the TextBox
and display the content in a Label
until you are ready to edit it.
At that point, hide the Label
and show the TextBox
.
Otherwise you'll have to subclass the TextBox
, and override the OnPaint
method, somewhat like the following:
protected override void OnPaint(PaintEventArgs e)
{
SolidBrush drawBrush = new SolidBrush(ForeColor); //Use the ForeColor property
// Draw string to screen.
e.Graphics.DrawString(Text, Font, drawBrush, 0f,0f); //Use the Font property
}
Take a look at this answer and this link.