用字体大小填充组合框 [英] Fill ComboBox with Font Size

查看:71
本文介绍了用字体大小填充组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何填充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);
}


这篇关于用字体大小填充组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆