I'm creating this application where I have a notify icon.
When the application is started the form will be hidden.
The tray icon works like this:
Click ? Set form location, show form, set form focus with Me.Activate()
Click ? Hide the form
Click ? Set form location, show form, set form focus with Me.Activate()
Click ? Hide the form
Click ? Set form location, show form, set form focus with Me.Activate()
Click ? Hide the form
(...)
and on and on...
But for instance. The last click on the tray icon, made the form visible and not hidden. But suppose I have a browser window open and I'm surfing the web and now I click the tray icon again... the form will be hidden and I want it to stay visible but to come up on top and focused and for that I need to validate (somewhere in my code-- I know where) if the form is focused or not. In this case it will not be visible and not focused so I'll just bring it to the front and I'll not hide it as it would happen in a normal situation. If it was visible AND focused, I would hide it.
Conclusion, how do I check if the form is focused or not?
Question
ProclaimDragon
Hi,
I'm creating this application where I have a notify icon.
When the application is started the form will be hidden.
The tray icon works like this:
Click ? Set form location, show form, set form focus with Me.Activate()
Click ? Hide the form
Click ? Set form location, show form, set form focus with Me.Activate()
Click ? Hide the form
Click ? Set form location, show form, set form focus with Me.Activate()
Click ? Hide the form
(...)
and on and on...
But for instance. The last click on the tray icon, made the form visible and not hidden. But suppose I have a browser window open and I'm surfing the web and now I click the tray icon again... the form will be hidden and I want it to stay visible but to come up on top and focused and for that I need to validate (somewhere in my code-- I know where) if the form is focused or not. In this case it will not be visible and not focused so I'll just bring it to the front and I'll not hide it as it would happen in a normal situation. If it was visible AND focused, I would hide it.
Conclusion, how do I check if the form is focused or not?
Edited by NazgulledLink to comment
Share on other sites
14 answers to this question
Recommended Posts