473,414 Members | 1,684 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,414 software developers and data experts.

How to check the item in a checkedlistbox control in code?

When I using the checkedlistbox1.items.add, I found that it can be set
the item is checked defaultly.
But how can I using the code to check an item in the list after
defined the list??

Thanks.

Jun 8 '07 #1
1 2298
Cylix,

Get the index of the item & then you can control it

Here's an example:

Create a new Windows Application
Add a CheckedListBox control

Form Load even:

With CheckedListBox1
.Items.Add("Tom")
.Items.Add("Dick")
.Items.Add("Harry")
End With

----------------

I put this behind a button for testing:

Dim i As Integer = CheckedListBox1.FindString("Dick")
CheckedListBox1.SetItemChecked(i, True)

--
Newbie Coder
(It's just a name)

"Cylix" <cy*******@gmail.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
When I using the checkedlistbox1.items.add, I found that it can be set
the item is checked defaultly.
But how can I using the code to check an item in the list after
defined the list??

Thanks.

Jun 8 '07 #2

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

Similar topics

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
3
by: Dean Slindee | last post by:
In a checked listbox, I am allowing drag/drop of the items within (resequencing). Problem is, when dropping a checked item, the checked state always reverts to unchecked (unwanted). Anyone know...
17
by: Aussie Rules | last post by:
Hi, I want to have a single line combo box dropdown, but where i can selected multiple items in the drop down via a check box... I can see one in the standard tool box... is there one ? If...
2
by: akunuri.swapna | last post by:
Hi All - I have a checkedListBox in my form. I am adding items to it at run time. However I also need to check the items depending on a condition. I have tried a lot but cant get the added item to...
5
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...
6
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
1
by: John | last post by:
Is there a way to make the font for the selected item(s) bold in a CheckedListBox? Thanks, John
1
by: ramkumar533 | last post by:
Hi all.. I am designig a form. its having a checkedlistbox control in vb.net2005 v1.2 . During the execution only one item should be checked at a moment. if one value is already selected,...
6
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...

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.