79621453

Date: 2025-05-14 12:24:44
Score: 0.5
Natty:
Report link

Taking it one stage further, allow for ANY of them on the same form :-

procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
  MousePos: TPoint; var Handled: Boolean);
begin
  if (ActiveControl is TDBLookupComboBox)
  then begin
        (ActiveControl as TDBLookupComboBox).Perform(WM_KEYDOWN, VK_DOWN, 0);
        Handled := True;
      end;
end;

procedure TForm1.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
  MousePos: TPoint; var Handled: Boolean);
begin
 if (ActiveControl is TDBLookupComboBox)
  then begin
        (ActiveControl as TDBLookupComboBox).Perform(WM_KEYDOWN, VK_UP, 0);
        Handled := True;
      end;
end;
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Andrew