By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,483 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,483 IT Pros & Developers. It's quick & easy.

CheckedState question

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies

P: n/a
"marcmc" <ma****@discussions.microsoft.com> schrieb
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
Nov 21 '05 #2

P: n/a
that looks good Armin. Thankyou.
How though can i see what is in the array?

Nov 21 '05 #3

P: n/a
ignore that last post Armin, you're code is perfect. Thankyou very much for
your help
marc

"Armin Zingler" wrote:
"marcmc" <ma****@discussions.microsoft.com> schrieb
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

Nov 21 '05 #4

P: n/a
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

"Armin Zingler" wrote:
"marcmc" <ma****@discussions.microsoft.com> schrieb
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

Nov 21 '05 #5

P: n/a
"marcmc" <ma****@discussions.microsoft.com> schrieb:
How though can i see what is in the array?


In which array?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #6

P: n/a
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" wrote:
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

Nov 21 '05 #7

P: n/a
"marcmc" <ma****@discussions.microsoft.com> schrieb
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
Nov 21 '05 #8

P: n/a
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
"Armin Zingler" wrote:
"marcmc" <ma****@discussions.microsoft.com> schrieb
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

Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.