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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:47:42+00:00 2026-06-12T14:47:42+00:00

I am developing a C# application in which a CheckedListBox is used. The CheckedListBox

  • 0

I am developing a C# application in which a CheckedListBox is used.

The CheckedListBox contains subject names like: Accounting, OC, Physics, Economics, Maths, etc…

I have one database table in which fees are associated with particular subjects:

Eg table name Fee:

Subject      |     Fee

Accounting         2000
Economics          3000
OC                 2000   

I want to build the application such that when a user clicks on a subject in the CheckedListBox, it’s fees should automatically be added to a total.

For that I have tried different CheckedListBox events: Click, SelectedIndexChanged, ItemCheck, etc…

But I am not getting the correct behavior when I make the first check on the CheckedListBox.

For the testing I have added the following subjects to the CheckedListBox: Accounting, Economics and Maths.

And this is what I have in my event handler:

for(int i=0; i<chlstbox.CheckedItems.Count; i++)
{
    messagebox.show(chklstbox.CheckedItems[i].ToString());
}

When I check the first subject Accounting then it does not shows me any message box. But when I click on Economics it shows me Accounts and then Economics.

In this case it should show me Accounting when i first click on Accounting. And there is no reply when I un-check the subjects.

What should I do? Is there any particular event or technique associated with it which I should use?

  • 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-12T14:47:44+00:00Added an answer on June 12, 2026 at 2:47 pm

    If you look at the ItemChecketEventArgs you will see the CurrentValue, OldValue and Index of the Item that is being Selected. So try something like this. The ItemCheck Event lets you know what is changing before it physically is changed.

    private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
    {
        if (e.NewValue == CheckState.Checked)
        {
            MessageBox.Show(checkedListBox1.Items[e.Index].ToString());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing application which needs to have functionality similer like built in Android SMS
I`m developing an application which receives data from my GPS device like coordinates, speed
We are developing an application which is read heavy and could possibly have millions
Am developing android application which contains floating menu effect from left to right. I
When developing an application which consumes an external webservice I have generated the sources
I am developing one application which need the following functionalities I have webserver. I
I am developing an application which users authlogic for authentication. I would like some
I am developing an application which should work under different languages (german, spanish, etc).
I am developing application which intend to be cross platform. I used to use
I have been developing the application which can manage a device using SMS commands;

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.