文本框的MultiLine设置为True,ScrollBar设置为Both,代码如下:
Private Sub Command1_Click()
Text1 = ""
For i = 32 To 126
Text1 = Text1 & Format(i, "@@@") & ": " & Chr(i) & " "
If (i - 31) Mod 7 = 0 Then Text1 = Text1 & vbCrLf
Next
End Sub
Dim n As Integer
n = 0
Text1.Text = ""
For i = 27 To 126
n = n + 1
If n Mod 7 = 0 Then
Text1 = Text1 & Space(2) & Chr(i) & Space(1) & i
Text1 = Text1 & vbCrLf
Else
Text1 = Text1 & Space(2) & Chr(i) & Space(1) & i
End If
Next
VB中在文本框中显示可打印的ASCII字符及其码值,…9995