Ok, update: I found a way around this - in the designer method that calls ShowUI, I first make a call to Control.Focus. Then the editor can close ok, and the SmartTags panel displays properly.
However, this leads to another question: when the designer calls Control.Focus, the control's LostFocus event fires. I know because I attached a handler to this event in my editor form:
designer.Control.LostFocus +=
new EventHandler(Control_LostFocus);
The code in the Control_LostFocus handler also closes the form- it is meant to cancel any editsin case the user clicks on another control while the editor is open, to prevent confusion. It has never fired until now - I assumed that was because the designer, not the actual control, had the focus. But now, the event triggers when the control
gets focus. Yet I double-checked, and the handler is definitely tied to the control's LostFocus, not anything of the designers.
Although this is technically the answer to this thread's question, I am not going to mark it as such right away. I would first like to see if anyone has any thoughts on the focus behavior. If I don't get any responses, I'll come back in a couple days to mark this as the answer.
Thanks,
Doug