Recent

Author Topic: Disable scroll in a TSpinedit  (Read 967 times)

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 68
Disable scroll in a TSpinedit
« 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...….





----------------------------------------
Lazarus version 2.0.12 64-bit
FPC 3.2.0

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Disable scroll in a TSpinedit
« Reply #1 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;

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: Disable scroll in a TSpinedit
« Reply #2 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];
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 68
Re: Disable scroll in a TSpinedit
« Reply #3 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
----------------------------------------
Lazarus version 2.0.12 64-bit
FPC 3.2.0

 

TinyPortal © 2005-2018