locked
How to set Font Size in code? RRS feed

  • Question

  • Hi,

    I am new to C# and have been searching for a simple way to set the Font Size for a textbox control. When I try to set it in the class constructor I'm told it is a read-only property.

    I've looked thru many help topics but can't find a clear answer.

    TIA,
    Karl
    Tuesday, June 20, 2006 7:32 AM

Answers

  • Fontsize is ReadOnly property but you can change Font Structure with similar code

    textBox1.Font = new Font(textBox1.Font.FontFamily.Name, 12.4);

    Tuesday, June 20, 2006 7:42 AM

All replies

  • Fontsize is ReadOnly property but you can change Font Structure with similar code

    textBox1.Font = new Font(textBox1.Font.FontFamily.Name, 12.4);

    Tuesday, June 20, 2006 7:42 AM
  • Thanks, that worked.

    I also found similar instructions under the Help for "Rich Textbox" control.
    Tuesday, June 20, 2006 7:51 AM