'大写转小写
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 90 Then
KeyAscii = KeyAscii + 32
End If
End Sub'小写转大写
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 90 Then
KeyAscii = KeyAscii + 32
End If
End Sub'小写转大写
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
{
this.textBox1.Text=this.textBox1.Text.ToUpper();
}
{
this.textBox1.Text=this.textBox1.Text.ToUpper();
this.textBox1.SelectionStart=this.textBox1.Text.Length;
this.textBox1.SelectionLength=0; }
默认是Normal,即不对输入的文本进行任何转换。
{
this.textBox1.Text+=e.KeyChar.ToUpper();
}
{
this.textBox1.Text+=e.KeyChar.ToUpper();
}