Results 1 to 3 of 3

Thread: Surely a dead easy ListBox question

  1. #1
    Guest
    I have ordinary ListBox. I woulld like that the first choice is highlighted when the ListBox is initially displayed. I tried

    List1.SetFocus

    but it does not highlight the first choice. When I run th program, I have to press DownArrow on keyboard for the first choice to be highlighted. I tried sending down key during the form load:

    SendKeys (DOWN)

    but it has no effect in highlighting, even if the first entry is selected (I can just press (OK) and it takes the first entry)

    With Combo box, I just have to set focus to have the Combo.Text highlighted in blue, but ListBox has no text property.

    What I really want to do is that the first entry is highlighted on the list, so that the user can just press (OK) on form to choose this choice, or the user can click/use arrow keys to get to his choice and then press (OK).

    What is so anoying is that I am sure it is some simple thing I am missing.

    Thanks

  2. #2
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Use the code:

    List1.ListIndex = 0

    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  3. #3
    Guest
    Thanks, it works.
    I knew it must have been a dead easy question.

    Cheers

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