Convert Text to Uppercase while typing in Text box

前端 未结 7 1773
我寻月下人不归
我寻月下人不归 2020-12-14 18:04

I am new in Visual Studio and using visual Studio 2008. In a project I want to make all text in uppercase while typed by the user without pressing shift key or caps lock on.

7条回答
  •  情书的邮戳
    2020-12-14 18:15

    There is a specific property for this. It is called CharacterCasing and you could set it to Upper

      TextBox1.CharacterCasing = CharacterCasing.Upper;
    

    In ASP.NET you could try to add this to your textbox style

      style="text-transform:uppercase;"
    

    You could find an example here: http://www.w3schools.com/cssref/pr_text_text-transform.asp

提交回复
热议问题