Private Sub Text1_Change() If Text1.Text ; "" Then If Asc(Text1.Text) ;= 65 And Asc(Text1.Text) = 90 Then Text2.Text = Chr(Asc(Text1.Text) + 32) ElseIf Asc(Text1.Text) ;= 97 And Asc(Text1.Text) = 122 Then Text2.Text = Chr(Asc(Text1.Text) - 32) End If End If End Sub 这个代码只能转换一个字母 Dim c As String Private Sub Command1_Click() c = "" If Text1.Text ; "" Then For a = 1 To Len(Text1.Text) If Asc(Mid(Text1.Text, a, 1)) ;= 65 And Asc(Mid(Text1.Text, a, 1)) = 90 Then c = c + Chr(Asc(Mid(Text1.Text, a, 1)) + 32) ElseIf Asc(Mid(Text1.Text, a, 1)) ;= 97 And Asc(Mid(Text1.Text, a, 1)) = 122 Then c = c + Chr(Asc(Mid(Text1.Text, a, 1)) - 32) End If Next a Text2.Text = c End If End Sub 这段是转换整个text控件里的文字的 不知道你需要的是那个
温馨提示:内容为网友见解,仅供参考