ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Focus Event (https://www.excelbanter.com/excel-programming/388571-focus-event.html)

Nigel

Focus Event
 
I have a userform that is loaded as modeless, so that the user can interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to detect
when the userform has focus?

Thanks

--
Cheers
Nigel





excelent

Focus Event
 
doubleclick on userform and insert

Private Sub UserForm_Click()
MsgBox ("Got focus")
End Sub


"Nigel" skrev:

I have a userform that is loaded as modeless, so that the user can interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to detect
when the userform has focus?

Thanks

--
Cheers
Nigel






Nigel

Focus Event
 
Thanks for that, I understand that if the user clicks the userform I can
determine if the userform has focus.
What I need to be able to do is test, in code, if the userform has focus or
not - before the user clicks the userform.


--
Cheers
Nigel



"excelent" wrote in message
...
doubleclick on userform and insert

Private Sub UserForm_Click()
MsgBox ("Got focus")
End Sub


"Nigel" skrev:

I have a userform that is loaded as modeless, so that the user can
interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to
detect
when the userform has focus?

Thanks

--
Cheers
Nigel








Jim Thomlinson

Focus Event
 
There really is nothing to tell you that the user form has focus. The click
event is close but if the user clicks on a button on the form instead of the
form itself then the userform gets focus without the userform_click event
firing. So basically you are on your own to come up with some sort of a
creative solution around your problem.
--
HTH...

Jim Thomlinson


"Nigel" wrote:

Thanks for that, I understand that if the user clicks the userform I can
determine if the userform has focus.
What I need to be able to do is test, in code, if the userform has focus or
not - before the user clicks the userform.


--
Cheers
Nigel



"excelent" wrote in message
...
doubleclick on userform and insert

Private Sub UserForm_Click()
MsgBox ("Got focus")
End Sub


"Nigel" skrev:

I have a userform that is loaded as modeless, so that the user can
interact
with the underlying worksheet.

Question: Is there an event I can use / create that allows my code to
detect
when the userform has focus?

Thanks

--
Cheers
Nigel










All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com