Focus Problem

  • Thread starter Thread starter Drew
  • Start date Start date
D

Drew

I've got a panel with labels on it which I've added to my main form.

I need the main form to have focus because it's got some key events on it.

The only way I've been able to get this to work is if I set this on the
panel and labels:

this.SetStyle(ControlStyles.Selectable,false);

Unfortunately, this method does not appear to be available in the Compact
Framework.

Any suggestions?

Drew
 
Can you intercept the GotFocus message on the panel and set focus back to
the Form inside your message handler?
Or, you can call the Win32 API SetWindowPos.
Hope this helps.
Thanks
Xin
 
Back
Top