Forum > General
[Solved] Open forms in a program
madref:
How do i keep track of all the windows that are open and in which ordered i opened them?
so i can close them in the right order
Thaddy:
--- Quote from: madref on July 29, 2024, 01:20:12 pm ---so i can close them in the right order
--- End quote ---
What is the right order in your case?
1. first openened first closed ( a queue )
or
2. last opened first closed ( a stack )
madref:
Option 2. Last open, first close
Thaddy:
Have a look at Screen.customforms[0]:Tcustomform;
The z-order 0 is always the last one. If that is closed or minimized, the z-order changes accordingly. Looks like just what you need.
https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tscreen.customforms.html
The global variable Screen of type TScreen is already defined.
alpine:
--- Quote from: Thaddy on July 29, 2024, 02:55:05 pm ---Have a look at Screen.customforms[0]:Tcustomform;
The z-order 0 is always the last one. If that is closed or minimized, the z-order changes accordingly. Looks like just what you need.
https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tscreen.customforms.html
The global variable Screen of type TScreen is already defined.
--- End quote ---
But It won't keep the order in which they're opened. Changing the focus will reorder the list also.
Navigation
[0] Message Index
[#] Next page