vb 在窗体上显示大写字母ABCD和小写字母abcd的所有组合

2024-12-04 01:53:41
推荐回答(2个)
回答1:

Private Sub Command1_Click()
Const L = "abcd"
Const U = "ABCD"

Dim i, j As Integer
Dim s(4) As String

Cls
For i = 1 To 4
For j = 1 To 4
s(j - 1) = Mid(U, i, 1) & Mid(L, j, 1)
Next j
Print s(0), s(1), s(2), s(3)
Next i
End Sub

回答2:

Private Sub Command1_Click()
For i = 0 To 3
For j = 0 To 3
Print Chr(65 + i); Chr(97 + j); " ";
Next j
Print
Next i
End Sub