Home > Net >  Combobox in Windows8.1 cannot change the selected item by using the mouse wheel
Combobox in Windows8.1 cannot change the selected item by using the mouse wheel

Time:11-08

Winform procedure, the picture has a combobox
In Win10, when I move the mouse to the combobox, don't click on the premise of this control, direct rolling roller can change the values of the currently selected combobox,
In Win8.1, do the same thing, the mouse wheel will not change the selected value of the combobox,
I think it is the operating system to the movement of the mouse in different ways lead to difference, but the specific reason in the official didn't find the related content,
Want to ask if anybody know clear reason, thank you

CodePudding user response:

This is not a problem of the operating system, but your approach,

To scroll wheel can change the values of the currently selected combobox, you must use the drop-down box becomes the active control,
So you have to deal with: MouseEnter event, can deal with,
 
Private Sub ComboBox2_MouseEnter (sender As Object, As EventArgs e) Handles ComboBox2. MouseEnter

'two way one can,

ComboBox2. Focus ()

Me. ActiveControl=ComboBox2

End Sub

CodePudding user response:

reference 1st floor tengwei6328 response:
this is not a problem of the operating system, but the way you handle,

To scroll wheel can change the values of the currently selected combobox, you must use the drop-down box becomes the active control,
So you have to deal with: MouseEnter event, can deal with,
 
Private Sub ComboBox2_MouseEnter (sender As Object, As EventArgs e) Handles ComboBox2. MouseEnter

'two way one can,

ComboBox2. Focus ()

Me. ActiveControl=ComboBox2

End Sub


Win10 without sets the active control is no problem, Win10 focus in A control, you move the mouse control, B need not change control activities, scroll wheel, the mouse B is trigger control rolling processing, but there is no such experience Win8.1

CodePudding user response:

It can't, Windows 7 also does not have the experience, if you want to compatible with different operating system differences, you can only such special handling the ~
  • Related