コード例 #1
0
        void SetUpPage(NetTabPage page, bool hidePage = true)
        {
            page.SuspendLayout();
            page.Visible &= !hidePage;

            int width  = owner.Size.Width;
            int height = owner.Size.Height;

            if (owner.Alignment == TabAlignment.Left || owner.Alignment == TabAlignment.Right)
            {
                width  -= owner.TabHeight + 1;
                height -= 2;
            }
            else
            {
                width  -= 2;
                height -= owner.TabHeight + 1;
            }

            page.Size = new Size(width, height);

            switch (owner.Alignment)
            {
            case TabAlignment.Left:
                page.Location = new Point(owner.TabHeight, 1);
                break;

            case TabAlignment.Top:
                page.Location = new Point(1, owner.TabHeight);
                break;

            default:
                page.Location = new Point(1, 1);
                break;
            }

            page.ResumeLayout(false);
        }