3 Timer Private Sub Timer 1Timer Label 1
3. Кодиране Задават се инструкции на обекта Timer Private Sub Timer 1_Timer() Label 1. Caption = Time End Sub
5. Кодиране n Инструкции на бутона Try Password: Password Private Sub Command 1_Click() If Text 1. Text = "secret" Then Timer 1. Enabled = False Msg. Box ("Welcome to the system!") End Else Msg. Box ("Sorry, friend, I don't know you. ") End If End Sub n Инструкции на обекта Timer: Timer Private Sub Timer 1_Timer() Msg. Box ("Sorry, your time is up. ") End Sub
7. Кодиране n Инструкции на бутона Set Alarm and Minimize: Private Sub Command 1_Click() Form 1. Window. State = 1 'Minimize form Timer 1. Enabled = True 'Start timer End Sub n Инструкции на бутона Quit: Quit Private Sub Command 2_Click() End Sub n Инструкции на обекта Timer: Timer Private Sub Timer 1_Timer() Current. Time = Format(Time, "hh: mm") If Current. Time = Text 1. Text Then Beep Msg. Box (Text 2. Text), , "Personal Alarm" Timer 1. Enabled = False Form 1. Window. State = 0 'Restore form End If End Sub
- Slides: 10