• 文本框回车触发,文本框内容变大写。

    分享到

    将文本框内容自动转为大写。

    虽然只有一行代码,但是不知道就是做不了

    private void TextBox_KeyPress(object sender, KeyPressEventArgs e)
    {
    //将用户输入的小写字母转成大写的形式
    e.KeyChar = char.ToUpper(e.KeyChar);
    }

    文本框回车触发事件

    这个没有什么难度,就是不记得……

            private void TextBox_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyValue == 13)
                {
                    Search_Click();
                }
            }
    蓝天.收藏与分享

    Tags: , , ,

Leave a comment