CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: ListBox problem

  1. #1
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    ListBox problem

    Hi,
    say if List1.List(x) is "Hello", then how to select the "Hello" in List1. By saying "Select", I mean to highlight the line "Hello" in List1. I could use List1.Text = "Hello", but what if there are multiple "Hello" lines, and I want to select all of them.

    Thank You



  2. #2
    Join Date
    Dec 2000
    Posts
    163

    Re: ListBox problem

    Very simple.

    write this line:

    List1.ListIndex = x 'x=number of the element to be selected





  3. #3
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: ListBox problem


    private Sub Command1_Click()
    ' List1.MultiSelect = true ' assign at Design time
    List1.Selected(2) = true
    List1.Selected(4) = true

    End Sub




    John G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured