Hello everybody
Could someone help me on this? I think it's pretty basic... newbie problems...
I have a Windows mobile application and what I'm trying to do is that when the user clicks a button for the first time it changes it's text to finish task.
Then when the user clicks it once again, a message box shows and ask if the user want to end task or not, if the user wants to end the task then click yes. With the click i put a true into a bool variable so he can't click again.
I'm doing it with a method from a class library and the problem is that i pass the bool variable to the method and it writes it inside the method but outside it remains the same
Here is the code so you can get the idea.

this is the button event inside the form

private void Start_EndBECbtn_Click(object sender, EventArgs e)
            Functions.SaveBEC(SavedYes, Start_EndTask, Start_EndBECbtn);            

and this is the method of the class Library

using System;
using System.Windows.Forms;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace jacg4Functions
    public class Functions
        static public void SaveBEC(bool _SavedOK, int Start_EndCtn, Button Start_Endbtn)
            if (Start_EndCtn == 1)
                Start_Endbtn.Text = "End Task";
                Start_Endbtn.Text = "End Task";
                if (Start_EndCtn > 1 && _SavedOK == false)
                    DialogResult dr = MessageBox.Show("Do you wish to end the task", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    if (dr == DialogResult.Yes)
                    { _SavedOK = true; }
                else if (Start_EndCtn > 1 && _SavedOK == true)
                    MessageBox.Show("You already finished the task", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);

tnx for any answer

Edited by jacg4: n/a

7 Years
Discussion Span
Last Post by jacg4
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.