Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to Fill Combo_Box whit Font Size to change size text of text_box?
Posted

1 solution

You can just fill your combobox with some size values like:
C#
comboBox1.Items.Add("8");
comboBox1.Items.Add("9");
comboBox1.Items.Add("10");
comboBox1.Items.Add("11");
comboBox1.Items.Add("12");
...

And then you can set the font size of your textbox using something like this:
C#
private void ComboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
  textBox1.Font = new Font(textBox1.Font.FontFamily, Convert.ToInt32(comboBox1.SelectedItem), textBox1.Font.Style);
}
 
Share this answer
 
Comments
amirmohamad 3-Oct-12 5:28am    
tank's for help JF2015
ridoy 3-Oct-12 5:34am    
great..+5

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