-
August 25th, 2005, 02:49 PM
#1
How to determine cause of Enter event?
I have a custom control. When focus is given to this control, the Enter event is triggered. Is there any way to determine what caused focus to come to this control (Tabbed in, Shift-tabbed in, mouse click)?
My control has various items on it. Depending on what caused my control to gain focus, I'd like to highlight one of them. For example, if the user clicks on an item, that item will be highlighted. If the user tabbed in from another control, then the "first" item will be highlighted, but if it was a shift-tab, then the "last" item will be highlighted.
Thanks for any help.
--
Scott
-
August 25th, 2005, 03:57 PM
#2
Re: How to determine cause of Enter event?
you need to have handlers for each of those use cases. enter is a generic event handler (meaning no extra info about the event is passed in).
-
August 26th, 2005, 07:34 AM
#3
Re: How to determine cause of Enter event?
Originally Posted by MadHatter
you need to have handlers for each of those use cases. enter is a generic event handler (meaning no extra info about the event is passed in).
That is what I figured, and I do have a handler for clicking for focus (MouseDown event), but I don't see an event for getting focus via tabbing.
I also though about watching for a click, followed by the focus event, but the focus event comes before the mouse down event. Anyone have an idea about how to do this?
--
Scott
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|