views:

159

answers:

3

Is there a way to get the form active control? I was checking in the help for the "Support.GetActiveControl" method but it isn't supported :) for the Compact Framework.

I suppose that I can track the focus by adding a custom GotFocus event handler to all the form controls, but I'm looking for a more generic way that can be implemented for any form.

+1  A: 

You can iterate over all the controls in the form and check which one is focused.

Itay
A: 

I'm not sure but I think ContainerControl.ActiveControl might work in CF.

ho1
+1  A: 

maybe the answer could be found here http://stackoverflow.com/questions/2899338/know-who-got-the-focus-in-a-lost-focus-event

Oops