CheckedState question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Below we can get the checkedItems within a checkedListBox but I have
attempted to find the unchecked items but I cannot seem to find a method. Is
there one or can I somehow manipulate the below code to find the uncChecked
items?

Dim ItemtoSet As New ArrayList

For Each CheckedItem As Object In ChkListBoxRoutines.CheckedItems
ItemtoSet.Add(CheckedItem)
Next
 
marcmc said:
Below we can get the checkedItems within a checkedListBox but I have
attempted to find the unchecked items but I cannot seem to find a
method. Is there one or can I somehow manipulate the below code to
find the uncChecked items?

Dim ItemtoSet As New ArrayList

For Each CheckedItem As Object In ChkListBoxRoutines.CheckedItems
ItemtoSet.Add(CheckedItem)
Next

for i as integer=0 to ChkListBoxRoutines.items.count-1
if not ChkListBoxRoutines.getitemchecked(i) then
...
end if
next i


Armin
 
that looks good Armin. Thankyou.
How though can i see what is in the array?
 
I have written... but it still seems to be adding the checked items to the
array!!

For UnCheckedItem As Integer = 0 To ChkListBoxRoutines.Items.Count - 1
If Not ChkListBoxRoutines.GetItemChecked(UnCheckedItem) Then
ItemtoSet1.Add(UnCheckedItem)
End If
Next UnCheckedItem
 
ignore that last post Armin, you're code is perfect. Thankyou very much for
your help
marc
 
The ItemtoSet1 array Heinfried.
Which leads me to another question, Can you add more than one value to an
arrayList in and/or create a multi-dimensional array?

Just something that croopped up a long time ago which I didn't get a chance
to work out at the time...
 
marcmc said:
The ItemtoSet1 array Heinfried.

Herfried, not Heinfried. :-)

Which leads me to another question, Can you add more than one value
to an arrayList

Well, a list is there to contain more values
in and/or create a multi-dimensional array?


No, but an item in the arraylist can be another arraylist or an array.


Armin
 
Just noticed apologies Herfried.
It's was one of those situations where I was attempting to remember
something so much that I forgot it, kinda like when you lose a PIN Number !!
Anyway thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top