1
I have a background image in my application, but it gives the impression of blinking due to the use of a 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;
Tell us what language you are using. Is the App Desktop, Web, Mobile? Provide more details to help us help you.
– Renatto Machado
How are you rendering it?
– Vinícius Gobbo A. de Oliveira
@Qmechanic73 No timer is seen the time to know if it is near 12h.
– Giovani
@Renattomachado is in Delphi, desktop application
– Giovani
@Viníciusgobboa.deOliveira, I just use a Timage and place a jpeg image
– Giovani
Post your event
OnTimer
.– Vinícius Gobbo A. de Oliveira
@Wineusgobboa.deOliveira posted
– Giovani
Unfortunately there’s nothing pointing to it. There’s something causing a
invalidate
in your form, which causes it to be rendered again. The only thing in this method that would do that is theMessageBox
when executed. Did you check if your form is using double buffering? Enabling double buffering will not remove the "redesign" of the form, but will probably make the blink disappear.– Vinícius Gobbo A. de Oliveira
Solved with this @Viníciusgobboa.deOliveira. Add as reply so I can mark as accepted. Thank you very much
– Giovani