Forum > Beginners

Close a form if another form is opened


Hi guys!

I make a program for students to practice calculating. For some kinds of practices, the students are allowed to use a calculator, which I already made in a single form, but for other practices, they are not allowed to use it. So when they open a form for practices with + - * / , the calculator have to can not be opened. And if the calculator is already opened, the form should close when another form is opened.
How can I achieve this?


you can set  visible property of the form (or hide procedure) and maybe a contitional global variable if required
also if you do not want to hide and show the form all the time you might want to just disable it with enable:=false
another way is to show the form inside the create event of the forms that you want it present and hide the form inside the onclose or ondestroy event of these forms


[0] Message Index

Go to full version