Listbox Question

  • Thread starter Thread starter David W
  • Start date Start date
D

David W

I made a calendar and in each day I used a listbox to display task that
needs to be completed. Everything works fine, but with one glitch.

Keep in mind, there are multiple listbox present.

If you set the background color to a dark color in the listbox, when you
select a record from the listbox, it stays highlighted. Now when you go to a
different listbox and select a different record, now both of the listboxes
have one record highlighted.
There are 42 listboxes within this calendar(one for each box/day) and if you
select a record from each one, you have 42 listboxes with one record
highlighted in each.
Is there a way to remove the highlight from a listbox when a different
listbox is selected while keeping a dark background color?

Thanks
David Whitaker
 
To remove a selection from a listbox, I set the listbox to NULL. For
example, if the name of your list box is lstDay1, on the Lost Focus event of
the listbox put the code

me.lstDay1 = NULL

I'm not sure why the background color is changing - perhaps you meant that
when a user enters the listbox you change the background color to dark? No
matter, just reset the background color in the Lost Focus event.

Hope this helps.
 
Hey, thanks!
That did it, using the null that is.
The background color is always set to a dark color to blend in with the
calendar(bright colors are more distracting to me). I dont change the color,
it stays the same. I just noticed when you use a bright color like white,
its not noticable.

Thanks
David Whitaker
 
Back
Top