|
Post by larrybtoys on Nov 15, 2023 6:34:08 GMT 1
Is there a way to check the visibility status of a window? I have a program that allows the user to open a second smaller window with some program information in it however sometimes users will click on the larger original window by accident covering up the smaller window. The program can't go on until they click the DONE button on the smaller window however they can't see it as the larger window is covering it up. I need to be able to check to see if this smaller window is on top and if not put it on top.
|
|
|
Post by dragonjim on Nov 15, 2023 12:56:01 GMT 1
Does this help?
OpenW 1 Win_1.Enabled = False OpenW Top 2, 200, 200, 200, 200 Ocx Command cmd = "Done", 10, 10, 100, 15 Do : Sleep : Until Win_1 Is Nothing
Sub cmd_Click CloseW 2 Win_1.Enabled = True Win_1.SetFocus End Sub
|
|
|
Post by larrybtoys on Nov 15, 2023 14:41:35 GMT 1
Yes...Thank you. I simply put these 3 lines just before I scanned for an input to ensure my new smaller window (#3) was the one they were clicking on.
If Win_3.SetFocus = False Win_3.SetFocus EndIf
Seems to do exactly what I need it to do.
|
|
|
Post by (X) on Nov 15, 2023 17:16:37 GMT 1
Polling the focus state of your form is an definite solution.
There a few other methods related to your desired form behaviour: <form>.OnTop, <form>.ToBack, <form>.ToTop and <form>.Zorder all have some special cases where they may contribute to the behaviour you desire.
From Help Doc...
|
|