Make TsDBLookupComboBox react to the mousewheel

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #68823
    HeDiBo
    Participant

    The standard TDBLookupComboBox does not react to the mouse wheel in its dropdown list. However this could very easily be implemented:

    
        procedure TsDBLookupComboBox.MouseWheelHandler(var Message: TMessage);
        var
          i: Integer;
        begin
          if ListVisible then
          begin
            for i := 0 to Mouse.WheelScrollLines - 1 do
              if Message.WParam < 0 then
                FDataList.Perform(WM_KEYDOWN, VK_DOWN, 0)
              else
                FDataList.Perform(WM_KEYDOWN, VK_UP, 0);
          end
          else
            inherited MouseWheelHandler(Message);
        end;
    

    Would you be willing to implement this?

    #68824
    HeDiBo
    Participant

    My code is only applicable to TDBLookupComboBox. For TsDBLookupComboBox the ListSW scrolling window should be used in a similar way.

    #68837
    Support
    Keymaster

    Thanks for code, I will try it soon.

    #68937
    HeDiBo
    Participant

    Will it still come in a next release?

    #68954
    Support
    Keymaster

    I have checked your solution and it did not help in my test.
    Data may be scrolled inside the ComboBox, but not in the popup window.
    You tried this solution?

    #68982
    Stephane Senecal
    Participant

    My 2 cent here, I think the mouse wheel should only work when the combobox’s list is dropped down, but not when the combobox’s list is closed even though it is Windows’s default behavior.
    We had many many problems with customers changing values without noticing by scrolling focused comboboxes (focus doesn’t mean under mouse cursor).

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #68985
    HeDiBo
    Participant

    Yes Stephane. I completely agree.

    #68998
    Support
    Keymaster

    This behavior will be changed in the v15.10

    #69005
    HeDiBo
    Participant

    It works now as expected 💎
    Please close this topic.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Make TsDBLookupComboBox react to the mousewheel’ is closed to new replies.