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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:18:04+00:00 2026-05-28T06:18:04+00:00

I have a CheckListBox in c# and I am trying to trigger an event

  • 0

I have a CheckListBox in c# and I am trying to trigger an event whenever one of the checkstates in the box is changed. The event purpose is to change some RichTextBox.

I have this piece of code, but it triggers the event only when one of the check boxes is turning from checked to unchecked, for some reason.
I tried to figure out what is wrong with my code with no success.
Any help will be appreciated.

    private void clbAllRooms_ItemCheck(object sender, ItemCheckEventArgs e)
    {
        //If the checkstate changed, update price  
        //It updates price only when the state turns from Checked to Uncheck
        if (e.NewValue != e.CurrentValue)
            Update_rtbPrice();
    }
  • 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-28T06:18:04+00:00Added an answer on May 28, 2026 at 6:18 am

    The trouble is no doubt located in your Update_rtbPrice() method. It would have to call the list box’ GetItemChecked() method to do something meaningful and that’s a problem when you make the method call from the event handler. The item check state doesn’t change until after the event runs.

    A workaround is to delay the call so it runs after the control’s state is updated. Like this:

        private void clbAllRooms_ItemCheck(object sender, ItemCheckEventArgs e) {
            this.BeginInvoke(new MethodInvoker(() => Update_rtbPrice()));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so, I have a checkListBox that i'm trying to get the value member of
I have a CheckedListBox, and I want to automatically tick one of the items
I have an ASPX C# page with a CheckListBox . Using the following code
I have a a wxPython checklist box that returns a list of integers. I
I have a checkedListBox (c#) and would like to have some of the boxes
I have this DataTable with the following structure: ID | VALUE ---------------- 1 |
have a XML file like this: <Datasets> <package id=AD> <iff>LRC_AD_AMSADTEXPDR</iff> </package> <package id=AL> <iff>LRC_AL_CLINICALTCODE</iff>
I have CheckedListbox bound to List. However I notice, the weird behavior of this
I have a DataBound CheckedListBox, I need to check some items on it. I
I have used a CheckedListBox over my WinForm in C#. I have bounded this

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.