D
Derek Martin
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(objecttest1.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
Dim result As New ArrayList
Try
For i = 0 To objecttest1.PersonList.person_returnnumber - 1
result =
objecttest1.PersonList.time_returnpunches(objecttest1.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