Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2060
UltraComboEditor - 14.2 - MouseWheel event not firing
posted

Hi,

I'm trying to stop the list in a UltraComboEditor from scrolling when the user uses the mouse wheel.

I've managed to do it on the UltraCombo by setting the following on the MouseWheel event of the control

Private Sub UltraCombo1_MouseWheel(sender As Object, e As MouseEventArgs) Handles UltraCombo1.MouseWheel


Dim mwe As HandledMouseEventArgs = DirectCast(e, HandledMouseEventArgs)
mwe.Handled = True


End Sub

However when I try to do the same on the UltraComboEditor the MouseWheel event doesn't seem to fire.

Private Sub UltraComboEditor1_MouseWheel(sender As Object, e As MouseEventArgs) Handles UltraComboEditor1.MouseWheel


Dim mwe As HandledMouseEventArgs = DirectCast(e, HandledMouseEventArgs)
mwe.Handled = True


End Sub

I've tried it on versions 13.2, 14.1 and 14.2 with the same result.

Is there an alternative approach for UltraComboEditors?

Kind regards,

Nathan

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Nathan,

    Both the UltraCombo and the UltraComboEditor show a TextBox control over themselves when in edit mode. This TextBox control gets the MouseWheel message.

    The UltraCombo is handling that MouseWheel message and passing it on to you. The UltraComboEditor is not. So this seems like a bug we need to look into.

    In the mean time, you can work around this by handling the MouseWheel event of the TextBox:


        Private Sub UltraComboEditor1_ControlAdded(sender As System.Object, e As System.Windows.Forms.ControlEventArgs) Handles UltraComboEditor1.ControlAdded
            AddHandler e.Control.MouseWheel, AddressOf Me.UltraComboEditor1_MouseWheel
        End Sub

        Private Sub UltraComboEditor1_ControlRemoved(sender As System.Object, e As System.Windows.Forms.ControlEventArgs) Handles UltraComboEditor1.ControlRemoved
            RemoveHandler e.Control.MouseWheel, AddressOf Me.UltraComboEditor1_MouseWheel
        End Sub

        Private Sub UltraComboEditor1_MouseWheel(sender As System.Object, e As System.Windows.Forms.HandledMouseEventArgs) Handles UltraComboEditor1.MouseWheel
            e.Handled = True
        End Sub

Reply Children
No Data