// 设置文本框的默认配置
        private void initTabPageConfig()
        {
            // 实例化一个Page
            RedrawTabPage page = this;
            // 设置Page的背景颜色为白色
            string timeStr = DateTime.Now.ToUniversalTime().Ticks.ToString();

            page.BackColor = Color.White;
            page.Name      = EnumUtils.GetDescription(DefaultNameEnum.TAB_PAGE_NAME) + timeStr;
            page.Text      = TabControlDataLib.PAGE_TEXT;
            page.UseVisualStyleBackColor = true;
            page.Padding     = new Padding(0, 20, 0, 0);
            page.Margin      = new Padding(0, 0, 0, 0);
            page.ToolTipText = page.Text;
            // 设置Page的大小
            page.Size = new Size(1, 1);
            // 进入控件事件
            page.Enter += (object sender, EventArgs e) => {
                ControlsUtils.TimersMethod(200, 1000, page.Parent, (object sender1, ElapsedEventArgs e1) => {
                    if (page.Controls.Count > 0)
                    {
                        Control con = page.Controls[page.Controls.Count - 1];
                        if (con != null)
                        {
                            page.FindForm().ActiveControl = con;
                            ((System.Timers.Timer)sender1).Dispose();
                        }
                    }
                });
            };
        }
 /// <summary>
 /// 显示添加标签按钮
 /// </summary>
 /// <param name="isShow">是否显示</param>
 /// <param name="transfer">是否立即调用一次点击事件</param>
 public void ShowAddPageButtton(bool isShow, bool transfer)
 {
     ShowAddPageButtton(isShow, transfer, new AddPageButInvoker(delegate {
         TabPage page = new RedrawTabPage();
         this.TabPages.Add(page);
         MainTabControlUtils.AddMainTextToPage(page, new RedrawTextBox());
         this.SelectedTab = page;
     }));
 }
 // 是否关联到状态栏
 private void statusBarAssociation(TabPage page)
 {
     if (page == null)
     {
         return;
     }
     if (page is RedrawTabPage)
     {
         RedrawTabPage p = (RedrawTabPage)page;
         p.IsAssociationStatusBar = this.IsAssociationStatusBar;
     }
 }
        /// <summary>
        /// 打开多例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initPrototypeExample(bool isShowTop)
        {
            RedrawTabPage conThis = this;

            conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.TAB_PAGE_NAME) + DateTime.Now.Ticks.ToString();;
            if (isShowTop)
            {
                conThis.BringToFront();
            }
            // 加入到多例工厂
            ControlCacheFactory.addPrototypeCache(DefaultNameEnum.TAB_PAGE_NAME, conThis);
            return(conThis);
        }
        /// <summary>
        /// 打开单例模式下的对象
        /// </summary>
        /// <param name="isShowTop">是否显示为顶层窗体</param>
        /// <returns></returns>
        public Control initSingleExample(bool isShowTop)
        {
            RedrawTabPage conThis = null;
            Control       con     = ControlCacheFactory.getSingletonCache(DefaultNameEnum.TAB_PAGE_NAME);

            if (con == null || !(con is RedrawTabPage))
            {
                conThis      = this;
                conThis.Name = EnumUtils.GetDescription(DefaultNameEnum.TAB_PAGE_NAME);
                ControlCacheFactory.addSingletonCache(conThis);
            }
            else
            {
                conThis = (RedrawTabPage)con;
            }

            if (isShowTop)
            {
                conThis.BringToFront();
            }
            return(conThis);
        }