/* public int Add(object text)
             * {
             *   TabPage tp = new TabPage();
             *   tp.Text = (string)text;
             *   Add(tp);
             *
             *   return getIndex(tp);
             * }*/

            public void Add(TabPage value)
            {
                this.Items.Add(value);

                __TabControl tc = (__TabControl)(Owner);
                __TabPage    tp = (__TabPage)value;

                var bg = this.Owner.GetHTMLTargetContainer();

                if (bg.firstChild == null)
                {
                    bg.appendChild(value.GetHTMLTarget());
                }
                else
                {
                    bg.insertBefore(value.GetHTMLTarget(), bg.firstChild);
                }

                var c = (__TabPage)value;

                c.InternalAssignParent(this.Owner);


                ((__TabControl)this.Owner).OnControlAdded(new ControlEventArgs(value));

                if (!firstSelected)
                {
                    firstSelected = true;
                    Owner.SelectTab(value);
                }
            }