Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Location
    St Louis
    Posts
    14

    Question Unanswered: Highlight a ListBox Row

    I have a form primarily containing a ListBox for choosing an employee etc...

    How do I force a row to be highlighted in a ListBox ?.

    I want the first row of the ListBox highlighted as a default when the form comes up before any user interaction. This would be repeated everytime the focus comes back to the form.

    The ListBox.GetFocus works fine but it doesn't always ensure a highlighted row. This just seems like I'm missing a proporty or something... Help

    Thanks

  2. #2
    Join Date
    Nov 2002
    Posts
    150

    Re: Highlight a ListBox Row

    Originally posted by Wlinks
    I have a form primarily containing a ListBox for choosing an employee etc...

    How do I force a row to be highlighted in a ListBox ?.

    I want the first row of the ListBox highlighted as a default when the form comes up before any user interaction. This would be repeated everytime the focus comes back to the form.

    The ListBox.GetFocus works fine but it doesn't always ensure a highlighted row. This just seems like I'm missing a proporty or something... Help

    Thanks
    In the activate event of the form put:

    Me.List25.Value = Me.List25.ItemData(0)

    where List25 = the name of your ListBox.

  3. #3
    Join Date
    Jan 2003
    Location
    St Louis
    Posts
    14

    Re: Highlight a ListBox Row

    Originally posted by FirstAndGoal4
    In the activate event of the form put:

    Me.List25.Value = Me.List25.ItemData(0)

    where List25 = the name of your ListBox.
    So easy when you know what your doing.....

    Thanks !

  4. #4
    Join Date
    Nov 2002
    Posts
    150

    Re: Highlight a ListBox Row

    Originally posted by Wlinks
    So easy when you know what your doing.....

    Thanks !
    Well, I have been using Access since the first beta... 1990??? I now do .NET be still like to dabble with Access.

  5. #5
    Join Date
    Jan 2003
    Location
    St Louis
    Posts
    14

    Re: Highlight a ListBox Row

    Originally posted by FirstAndGoal4
    Well, I have been using Access since the first beta... 1990??? I now do .NET be still like to dabble with Access.
    Well I've been using access for a long time also but only as a Database and not developing applications with it.... I'm a java / PowerBuilder person.... if you notice I used ListBox.Getfocus(PowerBuilder) instead of ListBox.SetFocus.... anyway thanks for the help and I'll remember you are using .NET. I may have to diversify....

Posting Permissions

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