selectgt
asked on
Find which form has the focus
Within my project, i'm looking to find whether
a) my application has the current focus and
b) if so, which form within my application has the current focus.
for b) i'd like to use the Forms collection if possible ..
i'd like to stay away from having to use a Global declaration to track which form has the current focus by using the Activate() event. That just feels like bad programming =\
a) my application has the current focus and
b) if so, which form within my application has the current focus.
for b) i'd like to use the Forms collection if possible ..
i'd like to stay away from having to use a Global declaration to track which form has the current focus by using the Activate() event. That just feels like bad programming =\
Use Screen.ActiveForm.Name to know the active form in your application
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Screen.ActiveForm.Name can be used with both MDI and SDI applications.
ASKER
does screen.activeform.name tell me whether or not my application in general is focused?
Yes it will, becuase whenever your application is focused you will have one of the forms in the application with the focus and this method will tell you that.
ASKER
Sethi: I also wanted to know when my application didn't have the focus as well. You solved half my problem, and thank you for that.. but the entire question was answered by venyon and his solution did work for me.
Thanks a bunch you guys.
Thanks a bunch you guys.
ASKER
Thank you kind sir, this was exactly what I needed.
enjoy!