473,811 Members | 2,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckedListBox-- item checkmark status?

Is there a simple way to check the status of an item as checked or unchecked
in a CheckedListBox?

I need to cycle through a CheckedListBox and take one of two actions for
each item, depending on whether the item is checked or unchecked. So the
CheckedItems property doesn't really help me. I expected something simple,
like checkedListBox1 .SelectedItem.C hecked, but I can't find any property
like that.

So, if I need to iterate through all of the items of a CheckedListBox and
determine whether each is checked or unchecked, how do I do it? Thanks.

--
Dave Veeneman
Foresight Systems
Nov 16 '05 #1
2 4942
I found it-- the list box has a GetItemChecked method that takes an index
and returns a bool. I don't know what drugs the Microsofties were doing when
they designed this control, but they must have been great!
Nov 16 '05 #2
"Dave Veeneman" <da****@nospam. com> wrote:
I don't know what drugs the Microsofties were
doing when they designed [CheckedListBox],
but they must have been great!


Agreed. Every other control would lead you to expect clb.Items[n].Checked;
and then there's the strange ItemCheck event where the item state *hasn't
actually changed yet* and you have to negate the value to use it.

P.
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4966
by: Tamir Gal | last post by:
Hi, I'm using the CheckedListBox control, and I'm wondering if there is a way to let the user check an item in the list without also selecting it... Any ideas? Thanks in advance, Tamir.
1
4154
by: fotis | last post by:
hi there can anybody tell me if it's possible and how can i change the name of a CheckedListBox item.I have used the Add method to insert the item. thank you
4
3799
by: Matthew | last post by:
Hi, I am using a checkedlistbox on a windows form and binding it to a collection of classes. clbAliases is the checkedlistbox control selectedplace is a class with property placealiases.This property is a collection of placealias classes. Hopefully the rest is self-explanatory..
8
1806
by: Derek Martin | last post by:
Here is some code that I need help with please: Dim result As New ArrayList Try For i = 0 To objecttest1.PersonList.person_returnnumber - 1 result = objecttest1.PersonList.time_returnpunches(objecttest1.PersonList.person_getb yid(i).userid, "03/08/2004", "03/09/2004", True, False) 'The above line returns an object with several proerties, namely, a punch id that I want to be able to get out of the checkedlistbox collection:
2
2311
by: Manuel Canas | last post by:
Hi there, I'm having this dilema with a checkedlistbox. I have an array of items in there, what I want to accomplish is the following; The user could check all the items in the checkedlistbox, but always have at list one item always checked. so if the user has the last item checked and he/she wants to uncheck it, the item should reset it self to a checked state
1
320
by: amruta | last post by:
How could I compare every item(text) checked in the checkedlistbox to any given string. If CheckedListBox1.CheckedIndices.Count > 0 Then For i = 0 To CheckedListBox1.CheckedItems.Count - 1 If CheckedListBox1. ?? = objReq.Owner.Name Then End If Next End If
5
6871
by: mabond | last post by:
Hi Can't believe I've not been able to find the answer to this in the on-line help. I have a CheckedListBox which, via a timer control, is populated with the names of files in a network folder. The "check mark" for each item in the control is determined by the boolean value of a custom property field of the file. That value is found using microsoft's dsofile.dll class.
6
4187
by: painkiller | last post by:
language: vb.net environment: windows forms .net : v1.1 i am having a checkedlistbox control that display document category such as text, image, video, audio etc. these values are coming from database. when a user clicks any of the above values and saves the form, the item's "value" is getting saved in database. and when a user logs back in, his/her previously checked value items should be shown as checked. Everything is working fine...
1
822
by: =?Utf-8?B?SEZMbw==?= | last post by:
Depending on how many items were selected by user in a CheckedListBox, I have a loop that calls SQL stored procedure for each CheckedListBox item selected. each sp takes few seconds to complete and I would like to show user that the process is still running. pls advice (with some sample code if possible) many thanks
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.