字符大小写转换程序,当文本框Text1中输入大写字母,在文本框Text2中同时显示其小写字母;当文本框Text1中输入小写字母,在文本框Text2中同时显示其大写字母;当输入其他字符,则原样输出。
建立两个文本框
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim x As String * 1
x = Chr$(KeyAscii)
Select Case x
Case "A" To "Z"
x = Chr$(KeyAscii + 32)
Case "a" To "z"
x = Chr$(KeyAscii - 32)
Case Else
x = x
End Select
Text2.Text = Text2.Text & x
End Sub