Results 1 to 5 of 5

Thread: [RESOLVED] ListView, selecting via code?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    93

    [RESOLVED] ListView, selecting via code?

    After I fill my listview control, I want to automatically select the first entry, which I do via:
    Code:
      lstRoster.ListItems.Item(1).Selected = True
      Call lstRoster_ItemClick(lstRoster.ListItems.Item(1))
    but the item isn't actually selected, how do I do that?
    Last edited by thetakerfan; Sep 18th, 2003 at 05:16 PM.

  2. #2
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747
    try

    set lvw.selecteditem = lvw.listitems(0)

    dunno if it would work

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    93
    Nope, same thing.
    It calls the ItemClick routine, but it isn't highlighted

  4. #4
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747
    umm how about lvwFeatures.ListItems(0).Selected = True

    other than that, i giveup!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    93
    Thanks for the help. It turned out being that I had HideSelection to True, and the form was getting focus after I set the selection, so the highlight went away. Problem solved, thanks again.

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