private void ControlToHook_LostFocus(object sender, EventArgs e) { focusedChild = null; GuiWidget currentWidget = widgetToSendTo; // try to remember the specific widget that has focus do { currentWidget = currentWidget.Children.Where(c => c.ContainsFocus).FirstOrDefault(); if (currentWidget != null && currentWidget.Focused) { focusedChild = currentWidget; break; } }while (currentWidget != null); widgetToSendTo.Unfocus(); widgetToSendTo.OnFocusChanged(e); }
private void controlToHook_LostFocus(object sender, EventArgs e) { widgetToSendTo.Unfocus(); widgetToSendTo.OnFocusChanged(e); }