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

How to get all selected items from CheckedListBox

Hi All,

I am using VB.NET 2005. I am using the control CheckedListBox control on my form, which is a collection of multiple check boxes. i am selecting multiple items from the collection and trying to get those selected items. for this i am using the property SelectedItems. but every time i am getting the last selected item. i tried the CheckedItems property. but this also gives the same result. i am not knowing where i am going wrong.

could any one help me in this regard.

Thanks in advance for any suggestions.

regards,
Sep 19 '07 #1
1 1870
Hi,

Here's a sample code where you can determine the checked items in your checklistbox control in vb.net (windows apps)

Dim itemsChecked As New ArrayList
Dim x As Integer
'this line is all you need
itemsChecked.AddRange(Me.CheckedListBox1.CheckedIt ems)
itemsChecked.TrimToSize()
For x = 0 To itemsChecked.Count - 1
MsgBox(itemsChecked.Item(x).ToString)
Next

Best Regards,
Ruel Sucgang




Hi All,

I am using VB.NET 2005. I am using the control CheckedListBox control on my form, which is a collection of multiple check boxes. i am selecting multiple items from the collection and trying to get those selected items. for this i am using the property SelectedItems. but every time i am getting the last selected item. i tried the CheckedItems property. but this also gives the same result. i am not knowing where i am going wrong.

could any one help me in this regard.

Thanks in advance for any suggestions.

regards,
Sep 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bobby | last post by:
I want to enable/disable individual items in a checkedlistbox. I have a field in a db that tells me whether the item should be enabled. I am just not sure how to disable an item in the...
2
by: Corey Scheich | last post by:
Coming from mostly VBA to VB.NET so bare with me. I am creating a form with a CheckedListBox. I want to populate the listbox as the user types in a value. I tried to use ...
0
by: Marcin Podle¶ny | last post by:
Hi, I need some help with my CheckedListBox. I'd like to set some of CheckedListBox items to read only. I would also like to set these items to look different than other items (i.e. they could be...
1
by: engloon | last post by:
In VB.NET, i want to create a checkedlistbox that contains some items. some of the items is checked based on some condition. if the item is checked, i don't want user to unchecked it, so i need to...
1
by: engloon | last post by:
hi guys, below is the code i wrote. but it only return the first checked item even i have 2 items checked. please help on this problem. any help would be appreciated, thanks. Dim indexchecked...
0
by: diego | last post by:
Greetings from the Philippines! I have a checkedlistbox contained in a tabpage of a tab control. i can programmatically check the items. i can see the items get checked when the tab page has...
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,...
1
by: TheDevelopers | last post by:
Hi All, I am using C#.NET 2005. I am using the control CheckedListBox control on my form, which is a collection of multiple check boxes. i am selecting multiple items from the collection and...
1
by: nczimm | last post by:
CheckedListBox1.SelectedValue does not seem to have a mechanism for identifying the selected items. It just takes the first item. There doesn't seem to be a way to relate checked items to selected...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.