VB 在文本框中输入字母,单击button1,转换为大写字母,单击button2,转换为小写字母。

2025-05-11 07:15:26
推荐回答(2个)
回答1:

这样可以不?

Private Sub Command1_Click()

Dim x As String

Dim y As String

Dim s As String

x = Text1.Text

If Option1.Value = True Then

For i = 1 To Len(x)

y = Mid(x, i, 1)

If y >= "a " And CH <= "z" Then

s = s + UCase(y)

ElseIf y >= "A" And y <= "Z" Then

s = s + LCase(y)

End If

Next i

Text2.Text = s

End If

If Option2.Value = True Then

x = UCase(x)

Text2.Text = x

End If

If Option3.Value = True Then

x = LCase(x)

Text2.Text = x

End If

End Sub

回答2:

1(基本应用题).如下图:编写程序,在文本框中输入英文字母,单击“大写”只题目2吗新建工程,添加四个Label,Caption属性分别为“边长a”“边长b”“