The question really doesn't explain the issue well.
I have a component that I am building that "hopefully" will be able to send a tab to the parent form to set focus on the next tabstop, I am having limited success.
When you click a button on the component. However, since my control will be getting focus when the button is selected, I can't tell which control had focus just prior.
Using SelectNextControl works ok except it only returns a bool value, so ultimately I need to store the first selected control to start with and index it as needed.
I've toyed with a dozen different scenarios including sendkeys (ugh) and forcing the host application to set a property in my control telling it which control is currently or most recently selected, but that adds overhead to the host application.
I'd really like some ideas on how to accomplish this efficiently.
I have a component that I am building that "hopefully" will be able to send a tab to the parent form to set focus on the next tabstop, I am having limited success.
When you click a button on the component. However, since my control will be getting focus when the button is selected, I can't tell which control had focus just prior.
Using SelectNextControl works ok except it only returns a bool value, so ultimately I need to store the first selected control to start with and index it as needed.
I've toyed with a dozen different scenarios including sendkeys (ugh) and forcing the host application to set a property in my control telling it which control is currently or most recently selected, but that adds overhead to the host application.
I'd really like some ideas on how to accomplish this efficiently.
Last edited: