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

CheckedListBox Question

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 =
objecttest1.PersonList.time_returnpunches(objectte st1.PersonList.person_getb
yid(i).userid, "03/08/2004", "03/09/2004", True, False)
'The above line returns an object with several proerties, namely, a
punch id that I want to be able to get out of the checkedlistbox collection:
For j = 0 To result.Count - 1
If result(j).approval = True Then
CheckedListBox1.Items.Add(result(j).ToString, True)
Else
CheckedListBox1.Items.Add(result(j).ToString, False)
End If
Next
Next
....
End Try

Okay so far...now, I want to find out which object ID's in the
checkedlistbox collection have what state:

Dim item As Object
Dim quote As String = """"
For Each item In CheckedListBox1.Items
MessageBox.Show("Item with id: " + item.GetType.ToString + _ 'Problem
is on this line
" is: " +
CheckedListBox1.GetItemCheckState(CheckedListBox1. Items.IndexOf(item)).ToStr
ing() + ".")
Next

The segment item.GetType.ToString returns System.String which is confusing
me because I think it means that the objects in the checkedlistbox
collection are string objects and not the objects themselves, which would
explain why I can't reference a member of the punch object (id). Is this
correct?

If it is, how can I do this so that I get the object's time property for
each indexed collection? For example, I am wanting:

checkedlistbox1 index = 0 results in this messagebox: Item with ID: 932 is:
unchecked
where '932' is the ID property of the time object that was loaded into the
checkedlistbox

Thanks so much!

Derek
Nov 20 '05 #1
0 689

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

Similar topics

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: 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...
2
by: CC | last post by:
Hi, We are populating a CheckedListBox from a database. Based on a selection by the user, the CheckedListBox either contains ALL possible members of a set, or a subset of possible members. The...
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: Moondog | last post by:
Simple question: How can I test if an item has been checked in a CheckedListBox? My scenario is if a user clicks on my CheckedListBox, and the item has not been checked yet, do some event, if...
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...
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
2
by: bh | last post by:
In the Listbox, there are properties for DisplayMember and ValueMember, just like the combobox, however, those properties are not present for the CheckedListBox. Does this mean that the only...
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
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?
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
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
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...

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.