vb的题目,关于大小写转换的,大虾帮帮忙
设计一个字符大小写转换程序,当文本框Text1中输入大写字母,在文本框Text2中同时显示其小写字母;当文本框Text1中输入小写字母,在文本框Text2中同时显示其大写...
设计一个字符大小写转换程序,当文本框Text1中输入大写字母,在文本框Text2中同时显示其小写字母;当文本框Text1中输入小写字母,在文本框Text2中同时显示其大写字母;当输入其他字符,则原样输出。
在网上也搜到了许多类似的答案,但在运行时text2就是没有字幕出现,高手能否再说的详细点 展开
在网上也搜到了许多类似的答案,但在运行时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
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
展开全部
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Dim a, b, s
For i = 1 To Len(Text1.Text)
x = Mid(Text1.Text, i, 1)
a = Asc(x)
If a >= 65 And a <= 90 Then
b = Chr(a + 32)
End If
If a >= 87 And a <= 122 Then
b = Chr(a - 32)
End If
If a < 65 And a > 122 Then
b = x
End If
s = s & b
b = ""
Next i
Text2.Text = s
End Sub
不知道题目的意识``给两种
Private Sub Text1_KeyPress(KeyAscii As Integer)
Static s
Dim a, b
a = KeyAscii
If a >= 65 And a <= 90 Then
b = Chr(a + 32)
End If
If a >= 87 And a <= 122 Then
b = Chr(a - 32)
End If
If a < 65 And a > 122 Then
b = Chr(a)
End If
s = s & b
b = " "
Text2.Text = s
End Sub
Text1.Text = ""
Text2.Text = ""
Dim a, b, s
For i = 1 To Len(Text1.Text)
x = Mid(Text1.Text, i, 1)
a = Asc(x)
If a >= 65 And a <= 90 Then
b = Chr(a + 32)
End If
If a >= 87 And a <= 122 Then
b = Chr(a - 32)
End If
If a < 65 And a > 122 Then
b = x
End If
s = s & b
b = ""
Next i
Text2.Text = s
End Sub
不知道题目的意识``给两种
Private Sub Text1_KeyPress(KeyAscii As Integer)
Static s
Dim a, b
a = KeyAscii
If a >= 65 And a <= 90 Then
b = Chr(a + 32)
End If
If a >= 87 And a <= 122 Then
b = Chr(a - 32)
End If
If a < 65 And a > 122 Then
b = Chr(a)
End If
s = s & b
b = " "
Text2.Text = s
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询