CheckedState question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marcmc

    CheckedState question

    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 ChkListBoxRouti nes.CheckedItem s
    ItemtoSet.Add(C heckedItem)
    Next


  • Armin Zingler

    #2
    Re: CheckedState question

    "marcmc" <marcmc@discuss ions.microsoft. com> schrieb[color=blue]
    > 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 ChkListBoxRouti nes.CheckedItem s
    > ItemtoSet.Add(C heckedItem)
    > Next
    >
    >[/color]

    for i as integer=0 to ChkListBoxRouti nes.items.count-1
    if not ChkListBoxRouti nes.getitemchec ked(i) then
    ...
    end if
    next i


    Armin

    Comment

    • marcmc

      #3
      Re: CheckedState question

      that looks good Armin. Thankyou.
      How though can i see what is in the array?

      Comment

      • marcmc

        #4
        Re: CheckedState question

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

        "Armin Zingler" wrote:
        [color=blue]
        > "marcmc" <marcmc@discuss ions.microsoft. com> schrieb[color=green]
        > > 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 ChkListBoxRouti nes.CheckedItem s
        > > ItemtoSet.Add(C heckedItem)
        > > Next
        > >
        > >[/color]
        >
        > for i as integer=0 to ChkListBoxRouti nes.items.count-1
        > if not ChkListBoxRouti nes.getitemchec ked(i) then
        > ...
        > end if
        > next i
        >
        >
        > Armin
        >[/color]

        Comment

        • marcmc

          #5
          Re: CheckedState question

          I have written... but it still seems to be adding the checked items to the
          array!!

          For UnCheckedItem As Integer = 0 To ChkListBoxRouti nes.Items.Count - 1
          If Not ChkListBoxRouti nes.GetItemChec ked(UnCheckedIt em) Then
          ItemtoSet1.Add( UnCheckedItem)
          End If
          Next UnCheckedItem

          "Armin Zingler" wrote:
          [color=blue]
          > "marcmc" <marcmc@discuss ions.microsoft. com> schrieb[color=green]
          > > 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 ChkListBoxRouti nes.CheckedItem s
          > > ItemtoSet.Add(C heckedItem)
          > > Next
          > >
          > >[/color]
          >
          > for i as integer=0 to ChkListBoxRouti nes.items.count-1
          > if not ChkListBoxRouti nes.getitemchec ked(i) then
          > ...
          > end if
          > next i
          >
          >
          > Armin
          >[/color]

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: CheckedState question

            "marcmc" <marcmc@discuss ions.microsoft. com> schrieb:[color=blue]
            > How though can i see what is in the array?[/color]

            In which array?

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://classicvb.org/petition/>

            Comment

            • marcmc

              #7
              RE: CheckedState question

              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:
              [color=blue]
              > 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 ChkListBoxRouti nes.CheckedItem s
              > ItemtoSet.Add(C heckedItem)
              > Next
              >
              >[/color]

              Comment

              • Armin Zingler

                #8
                Re: CheckedState question

                "marcmc" <marcmc@discuss ions.microsoft. com> schrieb[color=blue]
                > The ItemtoSet1 array Heinfried.[/color]

                Herfried, not Heinfried. :-)

                [color=blue]
                > Which leads me to another question, Can you add more than one value
                > to an arrayList[/color]

                Well, a list is there to contain more values
                [color=blue]
                > in and/or create a multi-dimensional array?[/color]


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


                Armin

                Comment

                • marcmc

                  #9
                  Re: CheckedState question

                  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:
                  [color=blue]
                  > "marcmc" <marcmc@discuss ions.microsoft. com> schrieb[color=green]
                  > > The ItemtoSet1 array Heinfried.[/color]
                  >
                  > Herfried, not Heinfried. :-)
                  >
                  >[color=green]
                  > > Which leads me to another question, Can you add more than one value
                  > > to an arrayList[/color]
                  >
                  > Well, a list is there to contain more values
                  >[color=green]
                  > > in and/or create a multi-dimensional array?[/color]
                  >
                  >
                  > No, but an item in the arraylist can be another arraylist or an array.
                  >
                  >
                  > Armin
                  >[/color]

                  Comment

                  Working...