A forms close 'X' in the top right hand corner.

Post

Posted
Rating:
#1 (In Topic #679)
Ade
Avatar
Trainee
 I'm new to GamBas and loving it as it brings back memories of using Basic on my old BBC Micro computer. Now using Linux, I am Starting to learn about the controls and events in GamBas.

Can somebody help me. I have 2 forms open on screen (eg Form1 and Form2), if Form 2 is closed using the 'X' in the top right hand corner, how can Form1 detect this when it happens ?.

Thanks in advance for any help you can give.
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
 Form2 has an event.
Public Sub Form_Close()

That is triggered when the close window is called


You can make a 'public' function in Form1…

Public Sub Form2Closed()

End

And in Form2 write.

Public Sub Form_Close()
Form1.Form2Closed()
End
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
If you are happy to have the 1st Form wait until 2nd Form is closed you can open the 2nd Form with:-

Code (gambas)

  1. Form2.ShowModal

The next command in the 1st Form will not be processed until the 2nd Form is closed.
Online now: No Back to the top

Post

Posted
Rating:
#4
Ade
Avatar
Trainee
Thanks guys,  tried both methods and it all work a treat. Great.   :D
Online now: No Back to the top
1 guest and 0 members have just viewed this.