This is my code:
if (RdoBtnBeepDefault.Checked) SystemSounds.Beep.Play();
else SoundPlayer iPlay = new SoundPlayer(@TxtBeepFile.Text);
iPlay.Play();
And here's the error:
Embedded statement cannot be a declaration or labeled statement
If that isn't possible, mind telling me how?
iPlay.Play(); is beyond the scope of your else clause in your if-else statement. Try enclosing it with braces for multiple line scope.
if (RdoBtnBeepDefault.Checked) 
{
    SystemSounds.Beep.Play();
)
else
{ 
    SoundPlayer iPlay = new SoundPlayer(TxtBeepFile.Text);
    iPlay.Play();
)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With