Winform控件输入的字母转换成大写

private void textBoxHbh_KeyPress(object sender, KeyPressEventArgs e)
{

if (e.KeyChar >= 'a' && e.KeyChar <= 'z')
{
this.textBoxHbh.Text = this.textBoxHbh.Text + e.KeyChar.ToString().ToUpper();
e.Handled = true;
textBoxHbh.SelectionStart = textBoxHbh.Text.Length;
}

}

原文地址:https://www.cnblogs.com/mengxiangzhi/p/6060727.html