سؤال

When a user click on label, it changes its color for some milliseconds and then returns to its previous color.

How to simulate this effect in Delphi?

هل كانت مفيدة؟

المحلول

One way would be set the font color when you click the item. Then start a TTimer:

Label.Font.Color := <insert your highlight color>;
TimerEffects.Enabled := true;

When the timer fires do something like this:

TimerEffects.Enabled := false;
Label.Font.Color := clBLack; // whatever color you want to set the label back to
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top