Search In ListBox

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

    Search In ListBox

    hi all.
    any one know a standard/free ListBox Control for vb.net
    that can be searched in, even in 'multiSelect' state?
    thanks.
  • Cor Ligthert

    #2
    Re: Search In ListBox

    Shachar,

    The listview in detail mode with one column comes in my opinion very near to
    what you ask.

    Cor

    next
    "shachar" <anonymous@disc ussions.microso ft.com>[color=blue]
    > hi all.
    > any one know a standard/free ListBox Control for vb.net
    > that can be searched in, even in 'multiSelect' state?
    > thanks.[/color]


    Comment

    • Cor Ligthert

      #3
      Re: Search In ListBox

      Shachar,

      The listview in detail mode with one column comes in my opinion very near to
      what you ask.

      Cor

      next
      "shachar" <anonymous@disc ussions.microso ft.com>[color=blue]
      > hi all.
      > any one know a standard/free ListBox Control for vb.net
      > that can be searched in, even in 'multiSelect' state?
      > thanks.[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Search In ListBox

        "shachar" <anonymous@disc ussions.microso ft.com> schrieb:[color=blue]
        > any one know a standard/free ListBox Control for vb.net
        > that can be searched in, even in 'multiSelect' state?[/color]

        Take a look at the listbox's 'FindString' and 'FindStringExac t' methods.

        --
        Herfried K. Wagner [MVP]
        <URL:http://dotnet.mvps.org/>


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Search In ListBox

          "shachar" <anonymous@disc ussions.microso ft.com> schrieb:[color=blue]
          > any one know a standard/free ListBox Control for vb.net
          > that can be searched in, even in 'multiSelect' state?[/color]

          Take a look at the listbox's 'FindString' and 'FindStringExac t' methods.

          --
          Herfried K. Wagner [MVP]
          <URL:http://dotnet.mvps.org/>


          Comment

          • Cor Ligthert

            #6
            Re: Search In ListBox

            >[color=blue]
            > Take a look at the listbox's 'FindString' and 'FindStringExac t' methods.
            >[/color]
            For multiselect?

            AFAIK does that find the first.

            Cor


            Comment

            • Cor Ligthert

              #7
              Re: Search In ListBox

              >[color=blue]
              > Take a look at the listbox's 'FindString' and 'FindStringExac t' methods.
              >[/color]
              For multiselect?

              AFAIK does that find the first.

              Cor


              Comment

              • Cor Ligthert

                #8
                Re: Search In ListBox

                Shachar,

                I am always strugling finding that multiselect settig of a listbox, I knew
                it again, this can be the code with a listbox.

                \\\
                ListBox1.Select ionMode = SelectionMode.M ultiExtended

                For i As Integer = 0 To ListBox1.Items. Count - 1
                ListBox1.SetSel ected(i, False)
                If ListBox1.Items( i).ToString.Ind exOf("a") <> -1 Then
                '"a" is any searchitem
                ListBox1.SetSel ected(i, True)
                End If
                Next
                ///

                I hope this helps?

                Cor
                "shachar" <anonymous@disc ussions.microso ft.com>
                ...[color=blue]
                > hi all.
                > any one know a standard/free ListBox Control for vb.net
                > that can be searched in, even in 'multiSelect' state?
                > thanks.[/color]


                Comment

                • Cor Ligthert

                  #9
                  Re: Search In ListBox

                  Shachar,

                  I am always strugling finding that multiselect settig of a listbox, I knew
                  it again, this can be the code with a listbox.

                  \\\
                  ListBox1.Select ionMode = SelectionMode.M ultiExtended

                  For i As Integer = 0 To ListBox1.Items. Count - 1
                  ListBox1.SetSel ected(i, False)
                  If ListBox1.Items( i).ToString.Ind exOf("a") <> -1 Then
                  '"a" is any searchitem
                  ListBox1.SetSel ected(i, True)
                  End If
                  Next
                  ///

                  I hope this helps?

                  Cor
                  "shachar" <anonymous@disc ussions.microso ft.com>
                  ...[color=blue]
                  > hi all.
                  > any one know a standard/free ListBox Control for vb.net
                  > that can be searched in, even in 'multiSelect' state?
                  > thanks.[/color]


                  Comment

                  • Herfried K. Wagner [MVP]

                    #10
                    Re: Search In ListBox

                    "Cor Ligthert" <notmyfirstname @planet.nl> schrieb:[color=blue][color=green]
                    > > Take a look at the listbox's 'FindString' and 'FindStringExac t' methods.[/color]
                    >
                    > For multiselect?
                    >
                    > AFAIK does that find the first.[/color]

                    ACK, but you can specify the index where the search should start. You can
                    use the index of the last element that was found using 'FindString' + 1 as
                    start index for the next call to 'FindString'.

                    --
                    Herfried K. Wagner [MVP]
                    <URL:http://dotnet.mvps.org/>


                    Comment

                    Working...