/// <summary>
        /// 添加文本框到标签页的方法
        /// </summary>
        public static void AddMainTextToPage(TabPage page, TextBox t)
        {
            string timeStr = DateTime.Now.ToUniversalTime().Ticks.ToString();

            // 判断要添加的标签是否为null,为null则新建一个标签并添加
            // t.Location = new Point(0, 2);
            t.Size = new Size(page.ClientSize.Width - t.Location.X, page.ClientSize.Height - t.Location.Y);
            if (page == null)
            {
                Control ccc = page.Parent;
                if (ccc != null && ccc is TabControl)
                {
                    AddControlsToPage((TabControl)ccc, page, t, true, true);
                }
            }
            else
            {
                page.Controls.Add(t);
                t.BringToFront();
            }
            ControlsUtils.TimersMethod(200, 1000, t, (object sender, ElapsedEventArgs e) => {
                if (t.FindForm() != null)
                {
                    t.FindForm().ActiveControl = t;
                    ((System.Timers.Timer)sender).Dispose();
                }
            });
        }
        // 关联状态栏
        public void statusBarAssociation()
        {
            TabPage pp = this;

            if (pp.Controls.Count > 0)
            {
                setSourceControl(pp);
                void setSourceControl(Control con)
                {
                    foreach (Control c in con.Controls)
                    {
                        if (c is TextBox || c is DataGridView)
                        {
                            ControlsUtils.TimersMethod(20, 2000, this, (object sender, ElapsedEventArgs e) => {
                                Control ccc = ControlCacheFactory.getSingletonCache(DefaultNameEnum.TOOL_START);
                                if (ccc != null && ccc is RedrawStatusBar)
                                {
                                    RedrawStatusBar bar = (RedrawStatusBar)ccc;
                                    bar.SetSourceControl(c);
                                    ((System.Timers.Timer)sender).Dispose();
                                }
                            });
                        }
                        else if (c.Controls.Count > 0)
                        {
                            setSourceControl(c);
                        }
                    }
                }
            }
        }
        // 设置文本框的默认配置
        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>
 private void initAddPageButton()
 {
     // 刚启动时父控件可能为空  循环判断tab的父控件是否为空
     ControlsUtils.TimersMethod(200, 1000, this, (object sender, ElapsedEventArgs e) => {
         addPageBut.Visible = IsShowAddPageBut;
         this.Parent.Controls.Add(addPageBut);
         addPageBut.BringToFront();
         this.SendToBack();
         ((System.Timers.Timer)sender).Dispose();
     });
 }