Click here to Skip to main content
14,541,963 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 1

Try:
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)
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100