ZoneWorkspace and focus

Topics: CAB & Smart Client Software Factory
Jul 12, 2006 at 12:48 PM
originally posted by: jercol

I'm having trouble using ZoneWorkspace because it sets focus to the outermost smart part whenever a nested control receives focus.

When a control receives focus via a mouse click, it notifies its parent ControlContainer which in turn notifies its parent ControlContainer, etc. Finally, the outermost ControlContainer calls its OnEnter which fires the Enter event. ZoneWorkspace has registered this event to call the SmartPartEntered handler. This handler calls ZoneWorkspace.OnActivate(Control) which then calls Control.Focus() thus removing focus from the originally clicked control.

Why does ZoneWorkspace behave this way? Is there any way to prevent this behavior other than modifying the CAB source code?

I've seen other odd behavior with ZoneWorkspace such as the caret appearing in one text box, but text getting inserted into another text box. I'm not sure if this is focus related as well.

Has anyone else run into this problem?