private void Speak_Button_Click(object sender, EventArgs e) { _synthesizer.SpeakAsyncCancelAll(); _synthesizer.SpeakAsync(Text_TextBox.Text); Text_TextBox.SelectionStart = 0; Text_TextBox.SelectionLength = 0; Text_TextBox.SelectAll(); }
private void QR_Yes_Button_Click(object sender, EventArgs e) { string text = ""; if (sender == QR_Dunno_Button) { text = "I don't know."; } else if (sender == QR_ExplainVoice_Button) { text = "For medical reasons I cannot speak for the time being, so I am using this computer assisted speech program to communicate."; } else if (sender == QR_Look_Button) { text = "Look here."; } else if (sender == QR_No_button) { text = "No"; } else if (sender == QR_ThankYou_Button) { text = "Thank you."; } else if (sender == QR_Yes_Button) { text = "Yes"; } Text_TextBox.Text = text; if (Speak_Button.Enabled) { Speak_Button.PerformClick(); } Text_TextBox.SelectionStart = 0; Text_TextBox.SelectionLength = 0; Text_TextBox.SelectAll(); }