I'm using Windows forms and I have a textbox which I would occassionally like to make the text bold if it is a certain value.
How do I change the font characteristics at run time?
I see that there is a property called textbox1.Font.Bold but this is a Get only property.
The bold property of the font itself is read only, but the actual font property of the text box is not. You can change the font of the textbox to bold as follows:
textBox1.Font = new Font(textBox1.Font, FontStyle.Bold);
And then back again:
textBox1.Font = new Font(textBox1.Font, FontStyle.Regular);