How to change selected value in combobox using mouse wheel ? (1 Viewer)

VBANewBie :)

Member
Local time
Today, 15:44
Joined
Apr 14, 2021
Messages
88
Hello everyone , I have a combobox which I need to change selected value up and down using the mouse wheel it could be bound or unbound is that possible ?

Thanks
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:44
Joined
Feb 19, 2013
Messages
16,614
why not just use a listbox set to one row high?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 09:44
Joined
May 21, 2018
Messages
8,529
I would set
Me.comboname.dropdown
In the combos key dowwn and mouse down. Then you can scroll with the wheel.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 09:44
Joined
May 21, 2018
Messages
8,529
why not just use a listbox set to one row high?
This is super confusing IMO. The value in the window is unlikely to be selected. The user has to remember to then select it too.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 09:44
Joined
May 21, 2018
Messages
8,529
I think in either case if you want to scroll and automatically select will require API.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:44
Joined
Feb 19, 2013
Messages
16,614
This is super confusing IMO.
true - I was assuming scroll and click. With a combo, if there are not enough rows there is nothing to scroll unless the combo list is set to 1 row high - and you still need to click.

It is just with a listbox, you don't need to click in order to scroll, just having the mouse over the control is sufficient, then click. With a combo, you need to click to expose the dropdown (tho' I guess you could use the combo mouseover event to expose it), but then you are moving the mouse from the control to the dropdown, scrolling then clicking.

But agree, to auto select will require an api if you don't want the user to select by clicking
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:44
Joined
Feb 19, 2002
Messages
43,275
I agree with the others. Even if you can figure out how to do this, it would be way too confusing and therefore prone to error. If the RowSource is sorted on the visible field, the best solution for scrolling is for the user to type. As he types subsequent characters, the list scrolls. If the user doesn't know the first few characters of what he is searching for, then you need to use a textbox where he can type in some characters surrounded by *'s and you then use Like *xxx* to help him.
 

Users who are viewing this thread

Top Bottom