Beispiel #1
0
        /// <summary>
        /// Sets a HeaderXOffset of the page and makes it remake its contour
        /// also increases 'offset' so next pages will get a correct offset
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="page"></param>
        /// <param name="offset"></param>
        void SetItemHeaderOffset(Position pos, TabPage page, ref Double offset)
        {
            if (this.HeadersPosition == Position.Left || this.HeadersPosition == Position.Right)
            {
                page.HeaderVerticalOffset = offset;
                offset += page.IsActive ? page.HeaderSizeActive.Height : page.HeaderSizePassive.Height;
            }
            else
            {
                page.HeaderHorizontalOffset = offset;
                offset += page.IsActive ? page.HeaderSizeActive.Width : page.HeaderSizePassive.Width;
            }

            offset -= 1;

            page.SetClip();

        }
Beispiel #2
0
        /// <summary>
        /// Sets a page as current and brings it to the front changing ZIndex property of all TabPages if it's active page -> 1 otherwise -> 0 
        /// </summary>
        /// <param name="pageToSet"></param>
        void ChangePage(TabPage pageToSet)
        {

            if (pageToSet == null || pageToSet == this.currentPage)
            {
                return;
            }

            this.currentPage = pageToSet;

            this.tabPageHeader.Text = this.currentPage.Header;
                
            double offset = 0;

            foreach (TabPage page in this.tabPages)
            {

                if (page != pageToSet)
                {
                    PageHolder.SetZIndex(page, 0);
                    page.IsActive = false;
                }
                else
                {
                    PageHolder.SetZIndex(page, 1);
                    page.IsActive = true;
                }

                this.SetItemHeaderOffset(this.HeadersPosition, page, ref offset);

            }

        }