I'd like the sender event to stop if the conditions of the if statement are met!!
private void Btn_Func(object sender, EventArgs e)
{
Button thisbutton = sender as Button;
if
(thisbutton.Text == "-" && lb_Display.Text == "")
lb_Display.Text += thisbutton.Text; [B][U]//I want the code to stop here if the conditions of the if are met![/U][/B]
else
VariableToCalculate_Value = lb_Display.Text;
lb_Display.Text = "";
switch (thisbutton.Text)
{
case "/": func = 4; break;
case "*": func = 3; break;
case "-": func = 2; break;
case "+": func = 1; break;
}
Memory_func = (thisbutton.Tag.ToString());
Application.DoEvents(); //this allows lb_Display to be refreshed before the voicelib is excuted.
SpVoice voice = new SpVoice(); // calls up a new instance of SpVoice
voice.Speak(Memory_func, SpeechVoiceSpeakFlags.SVSFDefault); // Speak everything in the label lb_Display using