1
Public Class Form1 Dim sapi Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Stop() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Label1.Text = TextBox1.Text End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Timer1.Interval = 1000 Label1.Text -= 1 If Label1.Text = 0 Then sapi = CreateObject("sapi.spvoice") sapi.speak(TextBox2.Text) Timer1.Stop() Timer1.Enabled = False End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Sourch Code Vb 2008 Jam Alarm

Embed Size (px)

DESCRIPTION

Sourch Code Vb 2008 Jam Alarm

Citation preview

Public Class Form1 Dim sapi Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Stop() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Label1.Text = TextBox1.Text End Sub

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Timer1.Interval = 1000 Label1.Text -= 1 If Label1.Text = 0 Then sapi = CreateObject("sapi.spvoice") sapi.speak(TextBox2.Text) Timer1.Stop() Timer1.Enabled = False

End If End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End SubEnd Class