Reputation: 31
SaveFileDialog sfd = new SaveFileDialog();
sfd.ShowDialog();
sfd.Filter("Wave Files|*.wav");
ss.SetOutPutToWaveFile(sfd.FileName);
ss.Speak(richTextbox.Text);
ss.SetOutputToDefaultAudioDevice();
Upvotes: 0
Views: 62
Reputation: 2075
if (sfd.ShowDialog() == DialogResult.OK){
//user saved it
}
else {
//write code to handle the case when an user does't save , and canceled it
}
Upvotes: 3
Reputation: 14059
Use a return value from sfd.ShowDialog()
:
if (sfd.ShowDialog() == DialogResult.OK)
{
// File was selected
}
else
{
// Cancelled
}
Upvotes: 2