Fórum Saber se um Form MDI esta aberto #585129
22/08/2017
0
Eu uso a seguinte procedure para abrir um form:
procedure AbreForm(aClasseForm: TComponentClass; aForm: TForm);
begin
Application.CreateForm(aClasseForm, aForm);
TForm(aForm).Show;
end;
obrigado.
Wilton Júnior
Curtir tópico
+ 0Post mais votado
22/08/2017
If (aForm = nil) then
{Código }
end;Você precisa setar nil ao form ao fechar, exemplo:
form1.Destroy; form1:=Nil; ;
Natanael Ferreira
Gostei + 1
Mais Posts
22/08/2017
Luiz Vichiatto
If (aForm = nil) then
{Código }
end;
https://www.devmedia.com.br/dicas-saber-se-um-form-esta-aberto-ou-nao/1576
Gostei + 0
22/08/2017
Wilton Júnior
if FrmProduto <> nil then
showmessage(aberto);
tentei aaté assigned
Eu preciso saber se o forma esta aberto.
Gostei + 0
22/08/2017
Luiz Vichiatto
if frmMain = nil then begin frmMain := TfrmMain.Create(self); frmMain.WindowState := wsMaximized; frmMain.Showmodal; end
outro trecho que também é significativo no sistema
if qrlfBloquetos <> nil then
with qrlfBloquetos do
begin
qryNotasBloqueto.Active := false;
qryBloqueto.Active := false;
tbBanco.Active := false;
tbLoja.Active := false;
end;
FreeAndNil( qrlfBloquetos );
Gostei + 0
22/08/2017
Luiz Vichiatto
for n:=0 to (MainForm.MDIChildCount-1)
begin
If MainForm.MDIChildren[n].Active then
begin
// do your thing here
end;
end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)