谁来帮我看下这段VB代码,重谢

来源:百度知道 编辑:UC知道 时间:2024/05/26 02:52:57
Public Sub Command1_Click()
Static b%
Call shuru
b = b + 1
Print b
If b = 2 Then
Text2.Text = str1(b - 1)
End If

End Sub
Public Sub shuru()
Static i%
i = i + 1
ReDim Preserve str1(i)
str1(i) = Text1.Text
Text1.Text = ""
End Sub

Public Sub Form_Load()
Public str1() As String, str2() As String
End Sub
我想在第一个文本筐里输入内容,然后将内容存如动态数组,然后在第2个文本筐里显示该内容,,。最好把正确的代码写上,谢谢,

Dim str1() As String, str2() As String

Public Sub Command1_Click()
Static b%
If Trim(Me.Text1.Text) <> "" Then
Call shuru
b = b + 1
If b >= 1 Then
Text2.Text = str1(b)
End If
Else
MsgBox "请输入信息!", vbExclamation
End If
'设置文本框焦点
Me.Text1.SetFocus
End Sub

Public Sub shuru()
Static i%
i = i + 1
ReDim Preserve str1(i)
str1(i) = Text1.Text
Text1.Text = ""
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
'13代表回车键
If KeyAscii = 13 Then
Command1_Click
End If
End Sub

'郁闷,居然不能排版!