Hi how can i make a windows form button work for on and off ? So when I click it the first time it turns my speech synthesis on and the next time i click it turns it off ? This is what i have tried but it doesn't work :(
private void button1_Click(object sender, EventArgs e)
{
SpeechSynthesizer SS = new SpeechSynthesizer();
bool onOff = true;
if (onOff == true)
{
SS.Speak(forReading.Text);
}
else if (onOff == false)
{
SS.Dispose();
}
}
forReading.Text is my textbox to read from.
I thought maybe using a bool(onOff) may be the way but I have no experience so im only guessing
HaKDMoDz