Click here to Skip to main content
Sign Up to vote bad
good
See more: C#
How to Fill Combo_Box whit Font Size to change size text of text_box?
Posted 2 Oct '12 - 21:41


1 solution

You can just fill your combobox with some size values like:
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:
private void ComboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
  textBox1.Font = new Font(textBox1.Font.FontFamily, Convert.ToInt32(comboBox1.SelectedItem), textBox1.Font.Style);
}
  Permalink  
Comments
amirmohamad - 3 Oct '12 - 5:28
tank's for help JF2015
ridoy - 3 Oct '12 - 5:34
great..+5

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Ron Beyer 220
1 OriginalGriff 203
2 Mahesh Bailwal 190
3 Aarti Meswania 185
4 Rohan Leuva 180
0 Sergey Alexandrovich Kryukov 8,548
1 OriginalGriff 6,819
2 CPallini 3,648
3 Rohan Leuva 2,933
4 Maciej Los 2,288


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid