初学者再请教啦
控件数组应用:实现电话拨号和重播
重播不了呀,我不明白时钟在这里的作用
Dim code As String
Private Sub Command1_Click(index As Integer) '拨号
Label1.Caption = Label1.Caption + Command1(index).Caption
End Sub
Private Sub Command2_Click() '清除
Label1.Caption = " "
End Sub
Private Sub Command3_Click() '重播
Timer1.Enabled = True
code = Label1.Caption
Label1.Caption = ""
End Sub
Private Sub Timer1_Timer()
Static n As Integer
n = n + 1
If n <= Len(code) Then
Label1.Caption = Label1.Caption + Mid(code, n, 1)
Else
Timer1.Enabled = False
n = 0
End If
End Sub