danz67
asked on
Delphi - MainForm
I have two forms, FormAzienda and FormMain, the startup form and FormAzienda, after entering some values in open ShowModal the FormMain.
The problem is that if you iconify the FormMain, the FormAzienda can be seen in the background. I tried several ways but failed to close the FormAzienda.
The problem is that if you iconify the FormMain, the FormAzienda can be seen in the background. I tried several ways but failed to close the FormAzienda.
Did you try to hide it ?
FormAzienda.hide;
FormAzienda.hide;
ASKER
Application.MainForm is FormAzienda
wimmeyvaert, I think that is the opposite , danz67 please correct me if I'm wrong :
the main form is FormAzienda, some values are entered (like a login)
and then only Main form is displayed as modal
If so, I would recommend Hiding FormAzienda before showing MainForm, and re-show it after ShowModal , something like this
the main form is FormAzienda, some values are entered (like a login)
and then only Main form is displayed as modal
If so, I would recommend Hiding FormAzienda before showing MainForm, and re-show it after ShowModal , something like this
procedure TFormAzienda.btnGoMain(Sender:TObject);
begin
Hide;
MainForm.ShowModal;
Show;
end;
You could also prevent MainFormof being Minimized.
Normally, when you show a form modally, you really need to close the formbefore you can continue.
So, better set the 'BorderIcons' property of the MainForm.
Set biMinimize and biMaximize to False.
Best regards,
Wim.
Normally, when you show a form modally, you really need to close the formbefore you can continue.
So, better set the 'BorderIcons' property of the MainForm.
Set biMinimize and biMaximize to False.
Best regards,
Wim.
ASKER
- wimmeyvaert:
The solution to hide the button I do not like, thanks.
- epasquier:
I attach pictures of what happens after writing HIDE
azienda.bmp
The solution to hide the button I do not like, thanks.
- epasquier:
I attach pictures of what happens after writing HIDE
azienda.bmp
ASKER
2 image
FormMain.bmp
FormMain.bmp
ASKER
3 image
result.bmp
result.bmp
hi
change the formStyle of mainform TO "fsNormal", both of them should be "fsNormal" in that kind of application system.
Mainform.formStyle := fsNormal;
You can change it in the form properties.
change the formStyle of mainform TO "fsNormal", both of them should be "fsNormal" in that kind of application system.
Mainform.formStyle := fsNormal;
You can change it in the form properties.
ASKER
It's already to fsNormal
This behavior happens when you minimize any form that's not the main form.
What you can do is simply make FormMain your main form instead of FormAzienda then when you done with FormAzienda just close it (FormAzienda.close;)
That should fix your issue.
What you can do is simply make FormMain your main form instead of FormAzienda then when you done with FormAzienda just close it (FormAzienda.close;)
That should fix your issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If so, then I don't understand how you can Minimize the MainForm before closing the FormAzienda.
When you show FormAzienda Modally, then you cannot click other forms before closing the FormAzienda.
Can you clarify a little bit please?
Thanks,
Wim.