VB中怎样让text中依次输入的数字成为数组中的数字啊?
1个回答
展开全部
输入数后按下回车键
Dim A() As Single
Private Sub Form_Load()
ReDim Preserve A(0) As Single
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim I As Integer
I = UBound(A)
ReDim Preserve A(UBound(A) + 1) As Single
A(I) = Val(Text1)
End If
Text1=""
End Sub
Dim A() As Single
Private Sub Form_Load()
ReDim Preserve A(0) As Single
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim I As Integer
I = UBound(A)
ReDim Preserve A(UBound(A) + 1) As Single
A(I) = Val(Text1)
End If
Text1=""
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询