Recent

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

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 61
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.2
FPC 3.0.4

Handoko

  • Hero Member
  • *****
  • Posts: 3763
  • 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

  • Sr. Member
  • ****
  • Posts: 374
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];
Lazarus 2.1 (SVN) / FPC 3.0.4 / FPC 3.2.0 / x86-win64 / Windows 8.1

SteenJorgensen

  • Jr. Member
  • **
  • Posts: 61
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.2
FPC 3.0.4

 

TinyPortal © 2005-2018