Lazarus

Programming => LCL => Topic started by: SteenJorgensen on December 06, 2019, 06:50:06 am

Title: Disable scroll in a TSpinedit
Post by: SteenJorgensen on December 06, 2019, 06:50:06 am
Is there a way to disable the mouseweel function in spinedit?

I miss a TSpinedit.AllowMouseweel := False...….





Title: Re: Disable scroll in a TSpinedit
Post by: Handoko on December 06, 2019, 07:19:16 am
You can try:

Code: Pascal  [Select]
  1. procedure TForm1.SpinEdit1MouseWheel(Sender: TObject; Shift: TShiftState;
  2.   WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
  3. begin
  4.   Handled := True;
  5. end;
Title: Re: Disable scroll in a TSpinedit
Post by: dsiders on December 06, 2019, 07:38:11 am
You can try:

Code: Pascal  [Select]
  1. procedure TForm1.SpinEdit1MouseWheel(Sender: TObject; Shift: TShiftState;
  2.   WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
  3. begin
  4.   Handled := True;
  5. end;

Not sure it handles wheel events, but perhaps this would work:

Code: Pascal  [Select]
  1. SpinEdit1.ControlStyle := SpinEdit1.ControlStyle - [csCaptureMouse];
Title: Re: Disable scroll in a TSpinedit
Post by: SteenJorgensen on December 06, 2019, 08:25:09 am
Thanks for reply. Wow, this works:

procedure TForm1.SpinEdit1MouseWheel(Sender: TObject; Shift: TShiftState;
  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
  Handled := True;
end;


Thanks - thanks - thanks :D