Fórum Erro ao encerrar aplicativo #449902
30/07/2013
0
var hora : TDateTime; begin stsMensagens.Panels[1].Text := TimeToStr(Time);
No evento onShow do Principal tenho o seguinte:
var
hora : TDateTime;
begin
hora := Time;
if (hora >= strtotime('00:00')) and (hora <= strtotime('11:59')) then
stsMensagens.Panels[2].Text:=' Bom Dia, '+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
if (hora >= strtotime('12:00')) and (hora <= strtotime('17:59')) then
stsMensagens.Panels[2].Text:=' Boa Tarde, '+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
if (hora >= strtotime('18:00')) and (hora <= strtotime('23:59')) then
stsMensagens.Panels[2].Text:=' Boa Noite, '+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
E no Sair tenho:
Application.Terminate;
Ao logar e depois clicar em Sair, está dando erro de Access Violation. Não sei o motivo.
Frederico Brigatte***
Curtir tópico
+ 0Posts
30/07/2013
Frederico Brigatte***
procedure TfrmPrincipal.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caNone; end;
No Activate está assim:
procedure TfrmPrincipal.FormActivate(Sender: TObject);
begin
stsMensagens.Panels.Items[0].Text := formatdatetime(' dddd", "dd" de "mmmm " de "yyyy', Now);
stsMensagens.Panels.Items[1].Text := formatdatetime(' hh:mm:ss', Now);
end;
Gostei + 0
30/07/2013
Frederico Brigatte***
procedure TfrmPrincipal.Timer1Timer(Sender: TObject);
var
hora : TDateTime;
begin
stsMensagens.Panels[1].Text := TimeToStr(Time);
hora := Time;
if (hora >= strtotime('00:00')) and (hora <= strtotime('11:59')) then
stsMensagens.Panels[2].Text:=' Bom Dia, '+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
if (hora >= strtotime('12:00')) and (hora <= strtotime('17:59')) then
stsMensagens.Panels[2].Text:=' Boa Tarde, '+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
if (hora >= strtotime('18:00')) and (hora <= strtotime('23:59')) then
stsMensagens.Panels[2].Text:=' Boa Noite, '+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
end;
Gostei + 0
30/07/2013
Wilton Júnior
o que vc acha disso
ar
hora : TDateTime;
begin
hora := Time;
if (hora >= strtotime('00:00')) and (hora <= strtotime('11:59')) then
stsMensagens.Panels[2].Text:=' Bom Dia ';
if (hora >= strtotime('12:00')) and (hora <= strtotime('17:59')) then
stsMensagens.Panels[2].Text:=' Boa Tarde ';
if (hora >= strtotime('18:00')) and (hora <= strtotime('23:59')) then
stsMensagens.Panels[2].Text:=' Boa Noite ';
stsMensagens.Panels[2].Text:= stsMensagens.Panels[2].Text+ frmPrincipal.UserControl1.CurrentUser.UserName +'. Bom Serviço! ©2012 - Todos os direitos resevados';
ondde vc colocou essa appliation terminate;
Gostei + 0
30/07/2013
Frederico Brigatte***
Gostei + 0
30/07/2013
Francisco Macário
Gostei + 0
30/07/2013
Frederico Brigatte***
Gostei + 0
30/07/2013
Francisco Macário
Timer1.Enabled := false;
Inclua no OnClose do Form principal.
Gostei + 0
30/07/2013
Frederico Brigatte***
Gostei + 0
30/07/2013
Frederico Brigatte***
Gostei + 0
30/07/2013
Frederico Brigatte***
frmPrincipal.UserControl1.Destroy;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)