Example #1
0
        void VisibleEditArea(bool bVisible)
        {
            this.checkBox_displayEditArea.Checked = bVisible;

            if (m_bEditAreaVisible == bVisible)
            {
                return;
            }

            if (bVisible == false)
            {
                // 隐藏编辑区域。相当于把装订控件直接放到顶层

                // 从集合中移出装订控件
                this.splitContainer_main.Panel2.Controls.Remove(this.bindingControl1);

                // 修改装订控件的位置和尺寸
                this.bindingControl1.Dock     = DockStyle.None;
                this.bindingControl1.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
                this.bindingControl1.Location = this.splitContainer_main.Location;
                this.bindingControl1.Size     = this.splitContainer_main.Size;
                if (this.Controls.IndexOf(this.bindingControl1) == -1)
                {
                    this.Controls.Add(this.bindingControl1);
                }

                this.Controls.Remove(this.splitContainer_main);
                ControlExtention.AddFreeControl(_freeControls, this.splitContainer_main);
            }
            else
            {
                // 显示编辑区域。相当于把分割控件直接放到顶层
                this.splitContainer_main.Dock     = DockStyle.None;
                this.splitContainer_main.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
                this.splitContainer_main.Location = this.bindingControl1.Location;
                this.splitContainer_main.Size     = this.bindingControl1.Size;

                this.Controls.Remove(this.bindingControl1);
                this.bindingControl1.Dock = DockStyle.Fill;
                this.splitContainer_main.Panel1.Controls.Add(this.bindingControl1);

                this.Controls.Add(this.splitContainer_main);
                ControlExtention.RemoveFreeControl(_freeControls, this.splitContainer_main);
            }

            this.m_bEditAreaVisible = bVisible;
        }
Example #2
0
        void HideHtmlControls(bool bHide)
        {
            if (bHide == true)
            {
                this.tabControl1.TabPages.Remove(this.tabPage_html);
                ControlExtention.AddFreeControl(_freeControls, this.tabPage_html);  // 2015/11/7

                this.tabPage_text.Text = "纯文本";
            }
            else
            {
                this.tabControl1.TabPages.Add(this.tabPage_html);
                ControlExtention.RemoveFreeControl(_freeControls, this.tabPage_html);

                this.tabControl1.SelectTab(this.tabPage_html);

                this.tabPage_text.Text = "HTML代码";
                this.tabPage_html.Text = "打印效果";
            }
        }
Example #3
0
 public void RemoveFreeControl(Control control)
 {
     ControlExtention.RemoveFreeControl(_freeControls, control);
 }