用字体大小填充组合框

问题描述:

如何填充Combo_Box的字体大小以更改text_box的大小文本?

How to Fill Combo_Box whit Font Size to change size text of text_box?

您可以在组合框中填充一些大小值,例如:
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);
}