The Delphi TLabel
can indeed be a flickery beast. Many people will recommend double buffering, but I don't like that. It brings other problems. In particular, if you are using themes then double buffering can interfere with the themed rendering.
My trick for dealing with label flicker is to use a TStaticText
instead of a TLabel
. This is a windowed control, a wrapper around the Windows STATIC
control, and in my experience it invariably will not flicker in the scenario where TLabel
would.
As others mention, throttling update rate is a sound idea, and is wise irrespective of flickering. There's no need to spend resources updating the UI any faster than the human eye can absorb. For something like download progress you should not really need any more than 5Hz in my view. This may very well be the root cause of your problem, and if throttling update rate solves the problem then you can stick with TLabel
.
My answer here has some more general anti-flicker tips: TLabel and TGroupbox Captions Flicker on Resize.
DoubleBuffered
property because it is not windowed. – MoroDoubleBuffered
property, but try setting TForm'sDoubleBuffered
property to true and check if flickering occurs again. – FaggotingTLabel
so often in the first place. Update it once every few seconds instead of on every KB value change, for instance store the latest value in memory somewhere and then use aTTimer
to update theTLabel
with the current value periodically. – Elohim