protected virtual void ResetMDITabsState()
            {
                bool bInvalidate = false;

                foreach (MDITab tab in _mdiTabs)
                {
                    if (tab.State != MDITab.EMDITabState.SELECTED && tab.State != MDITab.EMDITabState.NORMAL)
                    {
                        tab.State   = MDITab.EMDITabState.NORMAL;
                        bInvalidate = true;
                    }

                    if (tab.CloseButtonState != MDITab.EMDITabCloseButtonState.NORMAL)
                    {
                        tab.CloseButtonState = MDITab.EMDITabCloseButtonState.NORMAL;
                        bInvalidate          = true;
                    }
                }

                if (!_bDropDownFileListVisible && _dropDownFileListButtonState != EDropDownFileListButtonState.NORMAL)
                {
                    _dropDownFileListButtonState = EDropDownFileListButtonState.NORMAL;
                    bInvalidate = true;
                }

                if (bInvalidate)
                {
                    UpdateColors();
                }
            }
            public MdiClientController(Form parentForm)
            {
                // Initialize the variables.
                this.site        = null;
                this.parentForm  = null;
                this.mdiClient   = null;
                this.borderStyle = BorderStyle.Fixed3D;
                this.autoScroll  = true;

                _hook                        = IntPtr.Zero;
                _dropDownFileList            = new MetroDropDownPanel();
                _dropDownFileListSymbolFont  = new Font("Webdings", 9);
                _dropDownFileListButtonState = EDropDownFileListButtonState.NORMAL;
                _bDropDownFileListVisible    = false;

                // Set the ParentForm property.
                this.ParentForm = parentForm;
            }
            protected void OnUpdateMDIDropDownFileListButtonState(Point point)
            {
                bool      bInvalidate = false;
                Rectangle rc          = _tabsRectangle;

                rc = ParentForm.RectangleToScreen(rc);

                if (!rc.Contains(point))
                {
                    ResetMDITabsState();
                    return;
                }

                rc = _dropDownFileListButtonRect;
                rc = ParentForm.RectangleToScreen(rc);

                if (rc.Contains(point))
                {
                    if (_dropDownFileListButtonState == EDropDownFileListButtonState.NORMAL)
                    {
                        _dropDownFileListButtonState = EDropDownFileListButtonState.HOVER;
                        bInvalidate = true;
                    }
                }
                else
                {
                    if (_dropDownFileListButtonState == EDropDownFileListButtonState.HOVER)
                    {
                        _dropDownFileListButtonState = EDropDownFileListButtonState.NORMAL;
                        bInvalidate = true;
                    }
                }

                if (bInvalidate)
                {
                    UpdateColors();
                }
            }
            protected bool OnUpdateMDIDropDownFileListButtonSelection(Point point)
            {
                if (_mdiTabs.Count == 0)
                {
                    return(false);
                }

                bool      bInvalidate = false;
                bool      bRetVal     = false;
                Rectangle rc          = _tabsRectangle;

                rc = ParentForm.RectangleToScreen(rc);

                if (!rc.Contains(point))
                {
                    return(false);
                }

                rc = _dropDownFileListButtonRect;
                rc = ParentForm.RectangleToScreen(rc);

                if (rc.Contains(point))
                {
                    _bDropDownFileListVisible = true;

                    if (_dropDownFileListButtonState != EDropDownFileListButtonState.OPENED)
                    {
                        _dropDownFileListButtonState = EDropDownFileListButtonState.OPENED;
                        bInvalidate = true;
                    }

                    rc = _dropDownFileListButtonRect;
                    Rectangle wndRect = rc;

                    Point location = new Point((wndRect.Location.X + wndRect.Width) - _dropDownFileList.Width, wndRect.Location.Y + 15);

                    _dropDownFileList.Location = location;
                    _dropDownFileList.BringToFront();
                    _dropDownFileList.Visible = true;

                    bRetVal = true;
                }
                else
                {
                    if (_dropDownFileListButtonState == EDropDownFileListButtonState.OPENED)
                    {
                        _dropDownFileListButtonState = EDropDownFileListButtonState.NORMAL;
                        bInvalidate = true;
                    }

                    _bDropDownFileListVisible = false;
                    _dropDownFileList.Visible = false;
                }

                if (bInvalidate)
                {
                    UpdateColors();
                }

                return(bRetVal);
            }