Пример #1
0
        private void tabChanged(object s, EventArgs e)
        {
            PanelTabControl ptc = (PanelTabControl)s;

            if (ptc.IsNull())
            {
                return;
            }
            PanelTab selected = ptc.SelectedTab;

            if (selected.IsNull())
            {
                return;
            }
            if (selected == ChangelogTab)
            {
                this.ChangeSize(468, 482);
                lblPoweredBy.Location = new Point(148, 422);
                lblJustinOOO.Location = new Point(214, 422);
            }
            else if (selected == LoginTab)
            {
                this.ChangeSize(468, 337);
                lblPoweredBy.Location = new Point(148, 278);
                lblJustinOOO.Location = new Point(214, 278);
            }
            lblPoweredBy.BringToFront();
            lblJustinOOO.BringToFront();
            CenterToScreen();
        }
Пример #2
0
    public void DrawPanel(object sender, PaintEventArgs e)
    {
        Panel p = (Panel)sender;

        if (p == null)
        {
            return;
        }
        PanelTab modifying = tabs.Find(tab => tab.pnlBox == p);
        int      panelY    = modifying.pnlBox.Location.Y;
        Pen      myPen     = new Pen(Color_PanelBackground);

        if (drawBorders)
        {
            ControlPaint.DrawBorder(e.Graphics, p.ClientRectangle, Color_PanelOutline, ButtonBorderStyle.Solid);
        }

        if (type == PanelTabType.VerticalAttatched)
        {
            // simple attatched appearance
            e.Graphics.DrawLine(myPen, 0, modifying.pnlButton.Top - (panelY - 1), 0, modifying.pnlButton.Bottom - (panelY + 2));
        }
        else if (type == PanelTabType.ButtonBased)
        {
            // simply remove the line at the top
            if (!parent.IsNull() && parent.type == PanelTabType.VerticalAttatched)
            {
                e.Graphics.DrawLine(myPen, 1, 0, modifying.pnlBox.Width - 1, 0);
                // if it has a parent which is a vertical type, handle attatched appearance
                PanelTab parentModifying = parent.SelectedTab;
                int      parentPanelY    = parentModifying.pnlBox.Location.Y;
                int      topY            = parentModifying.pnlButton.Top - (parentPanelY - 1) - panelY;
                int      bottomY         = parentModifying.pnlButton.Bottom - (parentPanelY + 2) - panelY;
                e.Graphics.DrawLine(myPen, 0, topY, 0, bottomY);
            }
        }
    }