473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

programmatically check/uncheck all items in the checklistbox control

hi all,

i have a checklistbox populated with about 50 items from database. and on
the same form, i added to button to do the following.
[Check All] if you click this button, i want to have all items in the
checklistbox to be checked
[Uncheck All] i want to have all items in the checklistbox to be unchecked.

thanks advance, folks.

Nov 20 '05 #1
2 16564
Hi Mike,

Create a button called 'checkall'. Then in the click event, this code:
Dim i As Integer

For i = 0 To CheckedListBox1.Items.Count - 1

CheckedListBox1.SetItemChecked(i, True)

Next

Of course, the code simply need be changed to 'false' to reverse the
process.

HTH,

Bernie Yaeger

"Mike Kim" <mi*********@yahoo.com> wrote in message
news:uW*************@tk2msftngp13.phx.gbl...
hi all,

i have a checklistbox populated with about 50 items from database. and on
the same form, i added to button to do the following.
[Check All] if you click this button, i want to have all items in the
checklistbox to be checked
[Uncheck All] i want to have all items in the checklistbox to be unchecked.
thanks advance, folks.

Nov 20 '05 #2


Thanks Bernie,

What's exactly what i was looking for. Great day.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

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

Similar topics

6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
2
by: MikeY | last post by:
Hi all, I am coding window forms in C#. My problem is this: I have created a "Check ListView" or a 'ListView' with checkbox's. I have populated the it with my files from my folders, mps, txt,...
18
by: Julia Hu | last post by:
Hi, I have a datagrid, and in different rows I need to programmatically bind different type of controls and load data into these controls. For example,in the first row I need to bind data into a...
4
by: Sileesh | last post by:
Hi I have datagrid with 8 items. Out of which 2 items are checkboxes. Data is binded dynamically to the datagrid Based on some values from the database I have to check or uncheck the checkbox...
2
by: Rekha | last post by:
Hi I have datagrid with 5 items. Out of which 1 items are checkboxes. The bool column(checkbox column ) in added in datagrid. The rest of Data is binded dynamically to the datagrid Based on...
8
by: Hei | last post by:
Hi, any ideas how to constrain the numbers of item can check in CheckListBox. i would force user can only check one item. thx William
7
by: VB Programmer | last post by:
How do I create a submenu so that I can only check ONE of the values? Example: Menu --> Color SubMenu --> Red Value 1 --> Yellow Value 2 --> Green Value 3 Thanks....
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
3
by: Ryanfromscotland | last post by:
Hey there everyone, this is my first post so be nice :-) I have wrote quite a bit so the actual question is written out at the end if you want to skip on and see if you can answer it without the rest...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.