C# CF keep track of last control that had focus

  • Thread starter Thread starter pezi
  • Start date Start date
P

pezi

is there an "easy" way to implement this? (any api calls or something) ... i
don't want to add a lostfocus/gotfocus event on every control, because i
have plenty of them in my application

tia
pezi
 
The operating system knows who has the focus. You can P/Invoke GetFocus()
to get the HWND of the focused window in your application. You could build
an index of HWND to window classes or you could enumerate all of your
focusable windows to figure out which one is focused. Why do you need to
know?

Paul T.
 
hm...i'll take a look at that

i have a custom usercontrol and after clicking one of the buttons of this
control, some things according to the selected control should be done and
the control should get back the focus

pezi

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> schrieb im Newsbeitrag news:[email protected]...
 
Back
Top