'大小写字母转换器vb
'界面包括 command、command1、command2、command3 和一个 text 文本框
'command 为“互转”按钮,command1 为“转大”按钮,command2 为“转小”按钮,command3 为“清除”按钮
Private Sub Command_Click()
Dim i As Integer, n As Integer
Dim x As String, y As Integer, z
i = Len(Text.Text)
x = Text.Text
Text.Text = ""
For n = 1 To i
z = Mid(x, n, 1)
y = Asc(z)
If y > 96 And y < 123 Then
z = UCase(z)
ElseIf y > 64 And y < 91 Then
z = LCase(z)
End If
Text.Text = Text.Text & z
Next
End Sub
Private Sub Command1_Click()
Dim i As Integer, n As Integer
Dim x As String, y As Integer, z
i = Len(Text.Text)
x = Text.Text
Text.Text = ""
For n = 1 To i
z = Mid(x, n, 1)
y = Asc(z)
If y > 96 And y < 123 Then
z = UCase(z)
ElseIf y > 64 And y < 91 Then
z = z
End If
Text.Text = Text.Text & z
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer, n As Integer
Dim x As String, y As Integer, z
i = Len(Text.Text)
x = Text.Text
Text.Text = ""
For n = 1 To i
z = Mid(x, n, 1)
y = Asc(z)
If y > 96 And y < 123 Then
z = z
ElseIf y > 64 And y < 91 Then
z = LCase(z)
End If
Text.Text = Text.Text & z
Next
End Sub
Private Sub Command3_Click()
Text.Text = ""
End Sub