ImLearningDotNet
Member
Hello all,
The problem I am having is that I have a textbox that I have set the readOnly property to true. I have set the foreColor of that textBox to red but, the text remains black.
When I take off the read Only property then my text becomes red which is what I want but, I want the read Only property enabled as well. Does anybody know how to have a textBox with the ReadOnly property = True, and then be able to format the textBox with lets say
for currency and then change the text ForeColor to red.
As well as put a parenthesis around the text. I figure this:
I checked MSDN but when under ReadOnly property it says that :
"The ReadOnly property only affects user interaction at run time. You can still change text box contents programmatically at run time by changing the Text property of the text box."
But any changes I make to the text do not show in run-time.
The problem I am having is that I have a textbox that I have set the readOnly property to true. I have set the foreColor of that textBox to red but, the text remains black.
When I take off the read Only property then my text becomes red which is what I want but, I want the read Only property enabled as well. Does anybody know how to have a textBox with the ReadOnly property = True, and then be able to format the textBox with lets say
VB.NET:
TextBox.Text = Variable.ToString("C").
for currency and then change the text ForeColor to red.
VB.NET:
TextBox.ForeColor = Color.Red
As well as put a parenthesis around the text. I figure this:
VB.NET:
TextBox.Text = "(" & Variable.ToString("C") & ")"
I checked MSDN but when under ReadOnly property it says that :
"The ReadOnly property only affects user interaction at run time. You can still change text box contents programmatically at run time by changing the Text property of the text box."
But any changes I make to the text do not show in run-time.