Jump to content

Close form when clicking outside it


LogSistemas01

Recommended Posts

Hi

on formA on click event 

formB.close;

or

formB.hide;

Like so

procedure TMainForm.UniPDeskTopClick(Sender: TObject);
begin
  formB.show;
end;

procedure TMainForm.UniPDeskTopDblClick(Sender: TObject);
begin
  formB.Hide;
end;

Regards

  • Like 1
Link to comment
Share on other sites

On 8/23/2020 at 10:50 AM, mhmda said:

What is the purpose exactly? it's not clear what you want to achieve. 

 Don't forget the case when you have a callback procedure in parent form.

I would like to create a form that behaves like TUniPopup.

Put any control inside it, TUniEdit, TUniButton, TUniDBGrid.

For more or less this:

Step 1:
Normal Form:
1.png

 

Step 2:
Open popup form:
2.png

 

If I click anywhere on the form in step 1, the popup form is closed.

I know that if you put click routines on the form, it could work, but on a screen that could call 2-4 forms popup it would be bad, I would like something more automatic.

 

Something like this too:
3.png

Link to comment
Share on other sites

On 8/20/2020 at 4:43 PM, LogSistemas01 said:

I have 2 forms, A and B.
To show "Form A" call "Form B" with the procedure.

When I click on "Form A" again, I want "Form V" to be closed or hidden automatically.

It is possible?

Same with TuniPopup itself

Hello,

Can you please specify, which edition and build of UniGUI are you using?

I have a fix for this.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...