Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 private void controlToHook_LostFocus(object sender, EventArgs e)
 {
     widgetToSendTo.Unfocus();
     widgetToSendTo.OnFocusChanged(e);
 }