Bloom.Edit.EditingView.ParentForm_Activated C# (CSharp) Method

ParentForm_Activated() private method

private ParentForm_Activated ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        void ParentForm_Activated(object sender, EventArgs e)
        {
            if(!_visible) //else you get a totally non-responsive Bloom, if you come back to a Bloom that isn't in the Edit tab
                return;

            Debug.WriteLine("EditTab.ParentForm_Activated(): Selecting Browser");
            //			Debug.WriteLine("browser focus: "+ (_browser1.Focused ? "true": "false"));
            //			Debug.WriteLine("active control: " + ActiveControl.Name);
            //			Debug.WriteLine("split container's control: " + _splitContainer1.ActiveControl.Name);
            //			Debug.WriteLine("_splitContainer1.ContainsFocus: " + (_splitContainer1.ContainsFocus ? "true" : "false"));
            //			Debug.WriteLine("_splitContainer2.ContainsFocus: " + (_splitContainer2.ContainsFocus ? "true" : "false"));
            //			Debug.WriteLine("_browser.ContainsFocus: " + (_browser1.ContainsFocus ? "true" : "false"));
            //			//focus() made it worse, select has no effect

            /* These two lines are the result of several hours of work. The problem this solves is that when
             * you're switching between applications (e.g., building a shell book), the browser would highlight
             * the box you were in, but not really focus on it. So no red border (from the css :focus), and typing/pasting
             * was erratic.
             * So now, when we come back to Bloom (this activated event), we *deselect* the browser, then reselect it, and it's happy.
             */

            _splitContainer1.Select();
            //_browser1.Select();
            _browser1.WebBrowser.Select();

            _editButtonsUpdateTimer.Enabled = Parent != null;
        }