Lazarus

Programming => LCL => Topic started by: DenPit5 on February 13, 2019, 05:26:00 pm

Title: How to handle Buttons on TUpDown component ?
Post by: DenPit5 on February 13, 2019, 05:26:00 pm
Can anyone explain How to distinguish which of the two buttuns on the TUpDown control was pressed. ?
Title: Re: How to handle Buttons on TUpDown component ?
Post by: Handoko on February 13, 2019, 05:29:57 pm
Something like this below?

Code: Pascal  [Select][+][-]
  1. procedure TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);
  2. begin
  3.   case Button of
  4.     btNext: ShowMessage('Up is pressed');
  5.     btPrev: ShowMessage('Down is pressed');
  6.   end;
  7. end;
Title: Re: How to handle Buttons on TUpDown component ?
Post by: dsiders on February 13, 2019, 05:31:26 pm
Can anyone explain How to distinguish which of the two buttuns on the TUpDown control was pressed. ?

OnClick gets a TUDBtnType parameter: btPrev, btNext.
Title: Re: How to handle Buttons on TUpDown component ?
Post by: DenPit5 on February 13, 2019, 09:17:24 pm
Many thanks HanDoko and dsiders for replies. That is just what I required.   Thanks again.
TinyPortal © 2005-2018