���� ���� ������ ������� ���� 6 �� ����� ������� ���� ������� ��� ����

��� ����� ������ Timer

���� : ����� ���� ����� ���� (���) ���� �� ��� ����� ���� ( ��� ����� ��� ���� ) ��� 3 ����� ���� � ���� ������� �� label1

�� ���� ����� ���� � ���� ��� ������� ������� Command1-label1-timer1  ��� ������:

 

���� ��� �� ���� �� ������ timer1  ���� ������� ������ ��� � ��� Enabled  � �� ���� ���� ������� � ���� ����� Interval � �� �������� �� ����� � �� 1000 �� ����� �� ����� �� 3000 ������ 3 �����  .

�� ������ ������� � �� ������ ������ ��� ������ :

��� ���� ���� ������ ����� Enabled   ��� False ����� �� ���� �� ���� ������� �� ����� ����� ��������.� ���� �� ������ ����� Interval ��� 3000 ����� ���� �� ���� ������� ��� 3 ����� .� ���� ��� ����� ������� �� ����� �������� � ����� ��� ���� ����� .

������ :

������ ��������� ������� ������ ��������� � ����� ������ ������� ����� �� ��� Load   ������� Form1

Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 3000
End Sub

 

����  ����� Command1 � ���� ���� ���� ����� �� ���� ��� ������ ������� ���� ���� ������� � ��� ���� ����� ����� �������:

 

Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

���� ��� ������ ������ �������� ���� ���� �� ���� label1 ������� � ���� ��� ������� . �� ������� ������� � �� ���� ���� ���� ������ ������ �� ���� ������ (�����)

 

Private Sub Timer1_Timer()
Label1.Caption = "���� � ���� ���"
Timer1.Enabled = False
End Sub

����� ����� ���� ����� ���� � ���� ��� �� ������1 � � ����� ������ ���� ������ ��� ������� ��� �� ���� ���� ����� �� ���� ����� .

������ :

� ������ ������ ������ ���� � �� ������ :

Private Sub Timer1_Timer()
Label1= "���� � ���� ���"
Timer1.Enabled = False
End Sub

�� ������ �������� � ������

 

������ : ����� ��� ���� ����� ������

��� ����� ������ �� ���� ������ ������ � ���� �� ���� ��� ������� ���� 15 ����� � ���� ����� ����� ���� ��� ��� �

�� ��� �������� ��� ��� ������ ��� ���� Timer1 �� �������� . � ����� ��� Label1 ������ ����� ������ . � ������ ��� Command1 ������ ������� ������ ���� � ��� �� ���� ������ .

�� ������ ������� � �� ������ ������ ��� ������ :

��� ���� ���� ������ ����� Enabled   ��� False ����� �� ���� �� ���� ������� �� ����� ����� ��������.� ���� �� ������ ����� Interval ��� 1000 ����� ���� �� ���� ����� ����� Label1 �� �����  .

������ :

������ ��������� ������� ������ ��������� � ����� ������ ������� ����� �� ��� Load   ������� Form1

Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub

 

����  ����� Command1 � ���� ���� ���� ����� �� ���� ��� ������ ������� ���� ���� ������� � ��� ���� ����� ����� �������:

 

Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

���� ��� ������ ������ �������� ���� ���� �� ���� label1 ������� ��( 0 ) ��� ( 15 ) ��� ���� �� ����� ���� ��� ����� ������ � ���� ��� ������� �� ��� ��� ��� 15 ����� � ���� ��� ������� ����� . �� ������� ������� � �� ���� ���� ���� ������ ������ �� ���� ������ (�����)

 

Private Sub Timer1_Timer()

Label1.Caption = Val(Label1.Caption) + 1
If Val(Label1.Caption) = 15 Then
Timer1.Enabled = False
MsgBox ("����� �����")
End If


End Sub

Label1.Caption = Val(Label1.Caption) + 1

��� ����� ���� ������ 1 ��� �� ����� ��� ���� �� ����� ������ � ���� ��� 1 � ���� Val ������ �� ����� Label ��� ��� � �� ��� ����� 1 .

If Val(Label1.Caption) = 15 Then

 ����� ������ ��� ����� If � ������ ��� ���� ������� �� ����� Label1 � �� ������ ��� ���  � ��� ���� 15 ���� ����� ����� ���� ������ ������

Timer1.Enabled = False

��� ����� ���� ������ ��� ������� �� �� ���� ������ ��� ����� .

MsgBox ("����� �����")

��� ����� ���� ���� ��� ���� ��� ����� �����

End If

��� ����� ������ ���� �����

�� ������ �������� � ����� ��� ���� � ����� �������� � �� ����� ����� ����� ��� �� ��� ��� 15 ������� ���� ��� ������:

 

���� ����� ������ ������ ���������@2006