I'm trying to change a TLabel
color when the user touches it, but it looks like the MouseDown
event is not being fired.
procedure TForm_Master.tv_1Down(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Single);
begin
tv_1.FontColor := TAlphaColors.Dodgerblue;
end;
What could possibly be going wrong?
If we set HitTest
to True
, this control captures all mouse OnClick
and OnDblClick
events.
If we set HitTest
to False
, these two mouse-click events will pass through this control, so that a control laid out behind this one receives the mouse events instead of this control.
For most controls, HitTest
is True
by default. However, this is not true for TLabel
and TPathLabel
, where HitTest
is False by default; these two controls do not capture the OnClick
and OnDblClick
events unless you set HitTest
to True
.
http://docwiki.embarcadero.com/Libraries/XE8/en/FMX.Controls.TControl.HitTest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With