Avoid image blinking when timer is used

1

I have a background image in my application, but it gives the impression of blinking due to the use of Ttimer that the application has.

I tried to change the interval of Ttimer but the problem persists.

Any tips on how to solve?

Timer code:

procedure TfrmPrincipal.Timer1Timer(Sender: TObject);
begin

if ( TimeToStr(time) < '05:00:00' ) or ( TimeToStr(time) > '24:00:00' ) then Application.Terminate;

    if (timetostr(time) >= '23:50:00') and (timetostr(time) <= '24:00:00') then
    begin
    Timer1.Enabled := false;
    if frmmodulo.qrcaixa_operador.FIELDBYNAME('situacao').AsInteger = 1 then
    begin
    application.messagebox(Pchar('Já são ' + timetostr(time) +
    ' e o Caixa do dia ' + datetostr(frmmodulo.qrcaixa_operador.FIELDBYNAME
    ('data').asdatetime) + #13 + 'Ainda não foi fechado! Verifique!'),
    'Atenção', mb_ok + mb_iconwarning);
    end;
    Timer1.Enabled := true;
    end;

end;
    
asked by anonymous 03.02.2015 / 19:35

1 answer

0

Answer from Vinícius Gobbo A. de Oliveira:

  

Unfortunately, there's nothing to point it to. Is there something causing a   invalidate in your form, which causes it to be rendered   again. The only thing in this method that would do this is the MessageBox   when executed. You have verified that your form is using double   buffering? Enabling double buffering will not remove the "redraw" of the   form, but will probably cause the wink to blink.

    
09.02.2015 / 22:59