Click here to Skip to main content
12,449,440 members (62,843 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
How to Fill Combo_Box whit Font Size to change size text of text_box?
Posted 2-Oct-12 21:41pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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: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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160811.3 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100