ConfusedMuchMor 0 Newbie Poster

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.