How do I check if a control (in this case I am interested in the Table control) has focus? Is the only way to keep track with LostFocus and GotFocus via global variables and deduct the Table focus from that?
I didn't know about the Sender object, but as the table control has no GotFocus event I have solved my problem know with GotFocus and LostFocus.
The only relevant controls were 2 textboxes and a table control, so no problem there.
Thanks for the tip and I use the door library already to sort the table columns with a click on the headers and that works very nice. I noticed your code works with a timer and I am not keen to add that as I take it that there is some
overhead. Can't the door library check focus of controls without a timer?
The timer was just to show the state changing, when clicking either onto the table or the button, and nothing else.
You can check the Focused parameter where ever you want.
The Door method works nicely and quite simple, but I need to know the focus when I am clicking a menu item, so at that moment the table won't have focus.
So, I still will need to stick with the old method (tracking the textboxes focus) unless there was an event such as BeforeMenuClick.