Menu

#106 TSpeedButton.Down in OnClick is inverted

open
nobody
None
5
2002-02-14
2002-02-14
No

When a SpeedButton has:
GroupIndex = 1
AllowAllUp = True

The OnClick (and OnMouseUp) events are called
before the Down property is changed.
In VCL, the event is called later, so "Down" property
is appropiately True or False inside OnClick.

Steps:

-New form, add SpeedButton
-Set GroupIndex=1 and AllowAllUp=False
-Type this event and run the app:

Procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if SpeedButton1.Down then Caption:='Down'
else Caption:='Up;
end;

-Click the button, notice Form1.Caption is inverted.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB