Jump to content

TUniForm is Open


picyka

Recommended Posts

13 hours ago, picyka said:

Is there a way to know if a given form is open?

if UniMainModule.GetFormInstance(TUniFormVisualizarTarefa, false) then

I tried this rule but it didn't work.

I think it could possible do additional check:

Form := UniMainModule.GetFormInstance(TUniFormVisualizarTarefa, False);

if (not Assigned(Form)) and (not Form.Visible) then

 ..... form closed

Link to comment
Share on other sites

procedure TMainForm.UniTimerTarefasTimer(Sender: TObject);
begin
  UniTimerTarefas.Enabled := False;
  if UniMainModule.GetFormInstance(TUniFormVisualizarTarefa, False) = nil then
    Self.LoadTarefas(False);
end;

This validation is done within the timer, the FreeOnClose is already set to false.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...