Full Version: AutoSelect ListBox By Mouse Hover
UtterAccess Forums > Microsoft® Access > Access Forms
niesz
I thought I seen the solution to this somewhere, but I may have been imagining things...
Is there a way to highlight the items in a listbox as the mouse pointer moves across them, without holding down the left mouse button? Similar to the way a pull down menu or combo box works?
Don't you hate it when questions like this keep you up at night?
freakazeud
Hi,
have a look at this sample: mouseover listbox!
Obet you, you can modify it a little and make it work in VBA!
HTH
Good luck
niesz
Thought it was going to be a piece of cake from the example you gave... (Thanks, by the way!)
Unfortunately it needs the handle of the Listbox to make it work:
List1.hwnd
This one's a little out of my purview. I'll have to keep looking...
freakazeud
Sorry it didn't get you too far.
Omight take a look at it if I have some spare time throughout the day (no guarantees!).
Good luck.
cheekybuddha
Walter,
se the function here on Access Web to get the hWnd of a control.
But beware, Access listboxes behave differently from vb listboxes.
hth,
d
cheekybuddha
Alternatively, there is an example on the Stephen Lebans site that you can do the same with a continuous form (ie use it a s a faux listbox)
th,
d
niesz
Thanks, Cheeky. Actually I posted this question to see if I could come up with an alternate answer for our DropDown thread.
I was thinking of using a listbox instead of a combobox, as it does not have the selector button on the end. (Just making it visible when the button was pressed) But it does not have the selection behavior of a combobox. I think the OP got what he wanted, though.
cheekybuddha
Yes, I had thought of using a listbox instead of a combo too - but just that particular issue of not being able to highlight by mouseover prevented me!
Just tried this code with the listbox. Could only get it to return to the first item on the list on mouseover, but I might not have done it right.
d
niesz
Great minds think alike! frown.gif

(Is it wrong to post a thread to get an answer so you can give another answer to somone else?? LOL)
cheekybuddha
I'll be checking on you from now on - only kidding! wink.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.