473,320 Members | 1,940 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.

How do I get all the selected values from a CheckedListBox?

1
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 values.

Is there a way to get the selected value for all checked items in a checkedListBox?

Thanks
Aug 21 '09 #1
1 3066
tlhintoq
3,525 Expert 2GB
"Items" in a checkbox's Items collection have multiple properties. Including a value different than what is displayed. You can display "Fred" and have a value of '5'

Most times we just need a list of string and we are good with that
Items[0] = "Fred"
Items[1] = "Barney"
Items[2] = "Wilma"
and so on

If you just need that text you can do this...

String Person = CheckedListBox1.SelectedItem as string;
Aug 21 '09 #2

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

Similar topics

0
by: Matt C. | last post by:
Does the CheckedListBox support DisplayMember/ValueMember? I have been trying to use these properties with the CheckedListBox and they are not working. I see from Google that databinding is not...
4
by: Reza | last post by:
Hi, I want to check one of the memebrs of a checkedListbox based on its value. I 'm getting a number(say 1355) from another control and based on that number I want to check an item which its...
8
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 =...
2
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...
4
by: Hrvoje Voda | last post by:
How to move up and down a selected item in listcheckedBox? Hrcko
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...
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...
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 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...
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...
1
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
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.