473,396 Members | 2,070 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,396 software developers and data experts.

How to get all items in the checkedlistbox

11
hi, here's my code in checkelistbox which was already filled in upon loading of the form

Expand|Select|Wrap|Line Numbers
  1. myCheckedListBox.Items.Add("A")
  2. myCheckedListBox.Items.Add("B")
  3. myCheckedListBox.Items.Add("C")
  4. myCheckedListBox.Items.Add("D")
  5.  
so now, i want to get all the items from myCheckedListBox.

please help me figure out this matter.

RegARDs,
Arjel
Feb 18 '09 #1
2 10527
Curtis Rutland
3,256 Expert 2GB
To loop through all checked items:
Expand|Select|Wrap|Line Numbers
  1. Dim itemChecked as Object
  2. For Each itemChecked In myCheckedListBox.CheckedItems
  3.   'do what you need to do here
  4. Next
Or to get all items:
Expand|Select|Wrap|Line Numbers
  1. Dim item as Object
  2. For Each item In myCheckedListBox.Items
  3.   'Do what you need here
  4. Next
Feb 18 '09 #2
adsaca
11
dude, im using VB 2008 that's why your code doesn't work the way i want it. anyway, thanks for your response.
i already figured the solution to my problem

Expand|Select|Wrap|Line Numbers
  1. For ctr=0 To myCheckedListBox.Items.Count-1
  2.    myCheckedListBox.Items.Item(ctr)(1).ToString
  3.  Next
  4.  
where ctr is the row and 1,constant,refers to the column

tnx!
Feb 18 '09 #3

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...
0
by: pothik05 | last post by:
I can not make the DrawItem event to work on the CheckedListBox control. I suggestion will be highly appreciated. I have the following code. The code works for ListBox and the second item (Two)...
0
by: | last post by:
David, A partial answer to your question: The 'MultiColumn' property of a CheckedListBox does not cause it to display multiple FIELDS of an item... it causes it to display the items...
4
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...
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...
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: Terry Olsen | last post by:
Dim dirs() as string = Directory.GetDirectories(MyPath) CheckedListBox.DataSource = dirs CheckedListBox.Update For I as Integer = 0 To CheckedListBox.Items.Count - 1...
3
by: BostonNole | last post by:
Does anyone know how to get the checkedlistbox to display items horizontally on a windows form? It seems that it only displays its check box items vertically (up and down), which is not what I...
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
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
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
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,...

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.