VB中如果将print的结果显示在文本框中?
发布网友
发布时间:2023-10-12 04:04
我来回答
共4个回答
热心网友
时间:2024-12-02 23:26
'要选设Text1.MultiLine 属性为True
Private Sub Form_Click()
Dim jl As String
Dim i%, j%, S%
Static A As String
jl = "------乘法口诀表--------" & Chr(13) & Chr(10)
For i = 1 To 9
For j = 1 To i
S = i * j
jl = jl & Chr(13) & Chr(10) & i & "×" & j & "=" & S & Chr(13) & Chr(10)
Next j
Next i
Text1.Text = jl
End Sub
热心网友
时间:2024-12-02 23:27
print不行,那是古代的终端程序的输出。
Private Sub Form_Click()
Dim i%, j%, S%
Static A As String
A = "------乘法口诀表--------"
a = a & vbCrLf
For i = 1 To 9
For j = 1 To i
S = i * j
a = a & i & "×" & j & "=" & S,
Next j
a = a & vbCrLf
Next i
me.Text1.Text = a
End Sub
热心网友
时间:2024-12-02 23:27
将乘法表显示在text1.text中
Private Sub Form_Load()
Dim i%, j%, S%
Dim A As String, b As String
A = "------乘法口诀表--------" & vbCrLf
For i = 1 To 9
For j = 1 To i
S = i * j
Print i & "×" & j & "=" & S,
b = CStr(i) & "×" & CStr(j) & "=" & CStr(S)
A = A & b & Space$(8 - Len(b))
Next j
A = A & vbCrLf
Next i
Text1.Text = A
End Sub
热心网友
时间:2024-12-02 23:28
Private Sub command1_Click()
Static s As String
Dim m As String
Cls
For i = 0 To 2 Step 1
For j = 0 To 2 Step 1
s = Text1(i) & Text2(j)
m = m & " " & s & " " & Chr(13) & Chr(10)
Next
Next
Text3 = m
End Sub