Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys am having a little problem here
am trying to change font or text size in a rich box
i got the size listed in a combobox (the sizes are 10,12,14,16,20)
what i want to do is when you select a size i want the text in the richtextbox size to be change according to the selected size in the combobox

i tried this code
richTextBox1.SelectionFont = toolStripComboBox1.Size;
richTextBox1.Focus();
Posted

Try:
C#
richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont.FontFamily, 12.0F);
Where "12.0F" is the font size you want. (ComboBox.Size is a structure, and which says how big the combobox is, not what value the user selected)
 
Share this answer
 
Comments
sean871 5-Dec-12 11:37am    
thank you it worked

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900