mardi 5 mai 2015

C# checkbox and mouse click event

I am self teaching myself C# and ran into a problem I haven't seem to find an answer too. I have a Form that when I mouse click the check box the state goes to true but also immediately triggers the mouse click event I have code follows:

private void uxCheckBoxMouseClick(object sender, MouseEventArgs e)
    {
        //MouseEventArgs me = (MouseEventArgs) e;
        if (uxMouseCopyCheckBox.Checked)
        {
            MessageBox.Show("Test");
            uxMouseCopyCheckBox.Checked = false;

        }

I have searched the stack overflow and Google and found similar items but not in C# but no luck on the fixed solution. What I want to do it use the first click to change the check box to true without triggering the mouse click event. I want to delay the event to the 2nd mouse click and not the first.

I have tried the following: -for loop - Clicks == 2 with if statement - subscribing but at a loss on what to use




Aucun commentaire:

Enregistrer un commentaire