Imports SpeechLib
Imports System.Text.RegularExpressions
Public Class Form1
Dim compVoice As New SpVoice
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim regex As Regex = New Regex("^\d\d:\d\d")
Dim td As DateTime = DateTime.Now()
If CInt(TextBox1.Text) = td.Day Then
'run textbox1 here.
If regex.IsMatch(txtDay1.Text, 0) Then
compVoice.Volume = 100
compVoice.Speak("Warning")
compVoice.Volume = 50
compVoice.Speak(txtDay1.Text.Substring(6))
Else
compVoice.Speak("No text present.")
End If
ElseIf CInt(TextBox2.Text) = td.Day Then
'run textbox2 here
If regex.IsMatch(txtDay2.Text, 0) Then
compVoice.Volume = 100
compVoice.Speak("Warning")
compVoice.Volume = 50
compVoice.Speak(txtDay2.Text.Substring(6))
Else
compVoice.Speak("No text present.")
End If
ElseIf CInt(TextBox3.Text) = td.Day Then
If regex.IsMatch(txtDay3.Text, 0) Then
compVoice.Volume = 100
compVoice.Speak("Warning")
compVoice.Volume = 50
compVoice.Speak(txtDay3.Text.Substring(6))
Else
compVoice.Speak("No text present.")
End If
Else
Exit Sub
End If
End Sub
End Class