Edit: There has been a lot of views but no response. I think the way I wrote this could have been confusing so I am trying again.
Working on Windows 7.
The platform I am using is Windows 7.
I cannot get all the windows of my program to minimize and restore properly. What am I doing wrong?
I would like my program to minimize all open windows when I click the minimize button on the main window and restore all windows when the main program is double clicked in the task bar. When I close the program, all windows are closed using the following in the close event of the main window:
This works to close all windows.
Sub Close()
For i as Integer = WindowCount - 1 DownTo 0
Dim w as Window = Window(i)
If w <> nil then
w.Close
End if
Next
End Sub
I assumed that doing similar in the minimize and restore events of the main window would work like I wanted, but it does not. Doing these will minimize and restore most of the windows, but not all. It leaves a window or two hanging around on minimize and doesn’t restore all windows.
But these do not work to minimize and restore windows.
Sub Minimize()
For i as Integer = WindowCount-1 DownTo 0
Dim w as Window = Window(i)
If w <> nil then
w.Minimize
End if
Next
End Sub
Sub Restore()
For i as Integer = WindowCount-1 DownTo 0
Dim w as Window = Window(i)
If w <> nil then
w.Restore
End if
Next
End Sub
How do I minimize and restore all windows from the main program window?