WeifenLuo.WinFormsUI.Docking.DockPanel.SaveFocus C# (CSharp) Méthode

SaveFocus() private méthode

private SaveFocus ( ) : void
Résultat void
        internal void SaveFocus()
        {
            DummyControl.Focus();
        }

Usage Example

        private void SetParent(Control value)
        {
            if (Form.Parent == value)
            {
                return;
            }

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // Workaround of .Net Framework bug:
            // Change the parent of a control with focus may result in the first
            // MDI child form get activated.
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            bool bRestureFocus = false;

            if (Form.ContainsFocus)
            {
                DockPanel.SaveFocus();
                bRestureFocus = true;
            }
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            Form.Parent = value;

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // Workaround of .Net Framework bug:
            // Change the parent of a control with focus may result in the first
            // MDI child form get activated.
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            if (bRestureFocus)
            {
                Activate();
            }
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        }
All Usage Examples Of WeifenLuo.WinFormsUI.Docking.DockPanel::SaveFocus