Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 804095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:51:50+00:00 2026-05-14T23:51:50+00:00

I use checkbox in WPF window. I use some logic in unchecked event of

  • 0

I use checkbox in WPF window. I use some logic in unchecked event of checkbox. And I want to cancel uncheck if need it in the body of this event. How can I do this?

    private void chApprove_Checked(object sender, RoutedEventArgs e)
    {
        btnAddDepartment.IsEnabled = true;
        brnRemoveDepartment.IsEnabled = true;
    }

    private void chApprove_Unchecked(object sender, RoutedEventArgs e)
    {
        if (lbSource.Count == 0)
        {
            btnAddDepartment.IsEnabled = false;
            brnRemoveDepartment.IsEnabled = false;
        }
        else
        {
            MessageBox.Show("Staff already in use! Release it first from dependecies!");
            CheckBox myCheckBox = e.Source as CheckBox;
            myCheckBox.IsChecked = true;


        }
    }

Impossible to cancel uncheck !!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:51:51+00:00Added an answer on May 14, 2026 at 11:51 pm

    You could do this easily with an attached behavior (rather than using code behind), you can take a look at this answer if you need a sample of how to structure one (it’s only a few lines of code).

    My spider-sense is telling me this isn’t a very good idea though – I can’t imagine a way to “justify” rechecking a checkbox that a user has clicked, it just strikes me as very jarring. Can you not either bind the enabled state of the checkbox to a property on your ViewModel or, if you have an ICommand bound to it, use the CanExecute delegate to enable/disable it based on the same logic?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation says to use: $(input[type='checkbox']).bind( change, function(event, ui) { But I want to
can i change border color of checkbox by use css or jquery. i want
I want to make a bigger checkbox in WPF. I've discovered that I need
I use checkbox control in gridview i want to show confirm before checkboxchanged event.
I want to add a checkbox to my registration field for terms&use. How can
Why can't the data in mysql not updated when I use checkbox, I already
I use this code to determine checkbox width and height: var chk = $('input[type=checkbox]:first');
i use this javascript syntax for validating a checkbox... alert(document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked); if (document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked == false)
I need to dynamically generate radio or checkbox by jQuery. I use the following
How can I achieve a smaller checkbox input, for use in densely populated lists

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.