Process process; // Read Contetnt Mouse click event private SpeechSynthesizer readerSpeak; private void btnSpeakContent_Click(object sender, EventArgs e) { if(richTextBoxThanglish.Text.Trim() == string.Empty) { if (process.HasExited == false) process.Kill(); MessageBoxWrapper.ShowWarning("Textbox is Empty.", "ABTS", "Textbox is Empty."); process = Process.Start("narrator.exe"); } else { if (process.HasExited == false) process.Kill(); readerSpeak = new SpeechSynthesizer(); readerSpeak.SpeakAsync(richTextBoxThanglish.Text.ToString()); if (process.HasExited == true) process = Process.Start("narrator.exe"); } } private void btnStopSpeak_Click(object sender, EventArgs e) { if (process.HasExited == true) process = Process.Start("narrator.exe"); if (!(readerSpeak == null)) { readerSpeak.Dispose(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)