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 9163021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:20:49+00:00 2026-06-17T14:20:49+00:00

I have a few TextBoxes that are bound to a single CheckBox . This

  • 0

I have a few TextBoxes that are bound to a single CheckBox.

This is the logic associated with it:

  • If the Checkbox is checked, it will overwrite any existing text in the associated TextBoxes and make it ‘0’++
  • If all of the TextBoxes have a score of ‘0,’ the CheckBox should
    become disabled and checked.
  • If any of the TextBoxes then change from ‘0,’ it will become
    enabled and unchecked.

++ *Note:* The caveat to this is if the TextBox has a value of ‘C.’

Okay, so the issue I have is implementing the caveat above when one of the associated TextBoxes has a value of ‘C.’ What I would like to have happen is loop through the TextBoxes and check to see if any are scored ‘C.’ If one is found, display a warning message to the user confirming if they want to proceed. If Yes is selected, all associated scores will be overwritten to ‘0.’ If No is selected then the Checked event should be cancelled.

To accomplish this, I added Event Listeners for the CheckBox.PreviewMouseDown and CheckBox.Checked events. Here is the code for my CheckBox.PreviewMouseDown event listener:

private void NormalCheckBoxControl_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
    CheckBox normalCheckBox = (CheckBox)sender;
    bool showCorrespondingScoreWarningMsg = false;

    //Get a Row to loop through the AssociatedAdqScore controls for each
    ScoreControl tempScoreControl = new ScoreControl();

    foreach (ScoreControl score in this.ScoreControlList)
    {
        if (score.ScoreTextBox.Text == "C")
        {
            showCorrespondingScoreWarningMsg = true;
        }
    }

    if (showCorrespondingScoreWarningMsg)
    {
        MessageBoxResult msgResult = InformationBox.Show("WARNING: Proceeding will remove corresponding 'C' scores.  Continue?", "Continue?", ButtonStyle.YesNo, IconStyle.Question);

        if (msgResult == MessageBoxResult.No)
        {
            e.Handled = true;
        }
    }
}

This works if the user selects ‘No,’ however the issue I’m having is that when choosing ‘Yes,’ the CheckBox.Checked event still does not get fired. I have tried to manually set CheckBox.IsChecked = true; if if (msgResult == MessageBoxResult.Yes), but this breaks the bindings so that is not a viable solution.

Is there any way I can resolve this issue and proceed with the NormalCheckBoxControl_Checked(object sender, RoutedEventArgs e) event if the user selects ‘Yes?’

  • 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-06-17T14:20:50+00:00Added an answer on June 17, 2026 at 2:20 pm

    I don’t know of a “Checked” event, though there is a CheckedChanged event and also a CheckStateChanged event. I am used to .NET 2.0, so this may be a 3.0+ thing. Either way, I think I have manually called the event handler in instances like this without any problem.

    You can manually call the event handler with null params (or known object & new event args):

    NormalCheckBoxControl_Checked(null, null);
    

    or

    NormalCheckBoxControl_Checked(new object, new EventArgs());
    

    This should manually kick off your routine, and unless you need them, then there’s really no problem with providing dummy params. No need to raise an event and wait for it to bubble, just call the routine.

    Of course, if there are other routines which rely on the event bubbling or if you have multiple handlers for the same event, then it might cause you a problem. Be aware of that, just in case.

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

Sidebar

Related Questions

I have a few textboxes that are not required. If the user enters nothing
I have an asp.net 3.5 update panel and I have a few textboxes that
In my WinForms app, I have a few textboxes that the user typed some
I have MainForm on which i've loaded UserControl. This UserControl has few textboxes and
i have a single powerpoint slide that we use for reporting. This slidehas some
I have a form with few predefined textboxes, now in addition to that I
I have a ListView that displays a few TextBoxes . For each TextBox ,
I have a page that has a few textboxes and a dropdownlist. When a
Suppose I have a few TextBoxes in a VBA form, called Text1,Text2,Text3. I'm looking
I have an aspx page with a few textboxes and a submit button. Once

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.