示例#1
0
        /// <summary>
        /// Handles OnLeave for the LCCC.
        /// </summary>
        internal void OnLeave()
        {
            //_restoreFocusTargetControl = null;
            _focusedControlIndex = -1;
            _enteredState        = false;

            if (_control.ActiveLightweightControl != null)
            {
                LightweightControl focusedControl = _control.ActiveLightweightControl.GetFocusedControl();
                if (focusedControl != null)
                {
                    focusedControl.Unfocus();
                }
            }
        }
示例#2
0
        /// <summary>
        /// Handles OnLostFocus for the LCCC.
        /// </summary>
        internal void OnLostFocus()
        {
            if (_control.ActiveLightweightControl != null)
            {
                LightweightControl focusedControl = _control.ActiveLightweightControl.GetFocusedControl();
                if (focusedControl != null)
                {
                    if (_enteredState)
                    {
                        //Focus was lost, but since the control is in "entered" state, the focus needs
                        //to be restored to the appropriate subcontrol when focus returns to this control
                        //(this can happen when the active window changes)
                        _focusedControlIndex = GetFocusedControlIndex();
                    }
                    focusedControl.Unfocus();
                }
                _control.ActiveLightweightControl = null;
            }

            _control.Invalidate(true);
        }