Пример #1
0
        void TabControl_OnTabChanged(object NewTabData)
        {
            if (IsHandleCreated)
            {
                SendMessage(Handle, WM_SETREDRAW, 0, 0);
            }

            SuspendLayout();

            if (CurrentTabPanel != null)
            {
                CurrentTabPanel.Deactivate();
                CurrentTabPanel.Hide();
            }

            if (NewTabData == null)
            {
                CurrentTabPanel      = null;
                Settings.LastProject = null;
                DefaultControl.Show();
            }
            else
            {
                CurrentTabPanel      = (IMainWindowTabPanel)NewTabData;
                Settings.LastProject = CurrentTabPanel.SelectedProject;
                DefaultControl.Hide();
            }

            Settings.Save();

            if (CurrentTabPanel != null)
            {
                CurrentTabPanel.Activate();
                CurrentTabPanel.Show();
            }

            ResumeLayout();

            if (IsHandleCreated)
            {
                SendMessage(Handle, WM_SETREDRAW, 1, 0);
            }

            Refresh();
        }
Пример #2
0
        void TabControl_OnTabChanged(object NewTabData)
        {
            SendMessage(Handle, WM_SETREDRAW, 0, 0);
            SuspendLayout();

            if (CurrentWorkspace != null)
            {
                CurrentWorkspace.Deactivate();
                CurrentWorkspace.Hide();
            }

            if (NewTabData == null)
            {
                CurrentWorkspace             = null;
                Settings.LastProjectFileName = null;
                DefaultControl.Show();
            }
            else
            {
                CurrentWorkspace             = (WorkspaceControl)NewTabData;
                Settings.LastProjectFileName = CurrentWorkspace.SelectedFileName;
                DefaultControl.Hide();
            }

            Settings.Save();

            if (CurrentWorkspace != null)
            {
                CurrentWorkspace.Activate();
                CurrentWorkspace.Show();
            }

            ResumeLayout();

            SendMessage(Handle, WM_SETREDRAW, 1, 0);
            Refresh();
        }