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.
A forms close 'X' in the top right hand corner.
- BruceSteers
- Posts: 1574
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: A forms close 'X' in the top right hand corner.
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
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
Last edited by BruceSteers on Tuesday 1st June 2021 11:14am, edited 1 time in total.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: A forms close 'X' in the top right hand corner.
If you are happy to have the 1st Form wait until 2nd Form is closed you can open the 2nd Form with:-
The next command in the 1st Form will not be processed until the 2nd Form is closed.
Form2.ShowModal
The next command in the 1st Form will not be processed until the 2nd Form is closed.
Re: A forms close 'X' in the top right hand corner.
Thanks guys, tried both methods and it all work a treat. Great. ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)