Ejemplo n.º 1
0
 private void RedrawBands()
 {
     for (int i = 0; i < Controls.Count; i++)
     {
         BandPanel bp = Controls[i] as BandPanel;
         RecalcLayout(bp, i);
     }
 }
Ejemplo n.º 2
0
        public void AddBand(string caption, ContentPanel content)
        {
            content.outlookBar = this;
            int         index     = Controls.Count;
            BandTagInfo bti       = new BandTagInfo(this, index);
            BandPanel   bandPanel = new BandPanel(caption, content, bti);

            Controls.Add(bandPanel);
            UpdateBarInfo();
            RecalcLayout(bandPanel, index);
            bandPanel.BackColor = Color.Azure;
        }
Ejemplo n.º 3
0
        private void RecalcLayout(BandPanel bandPanel, int index)
        {
            int vPos   = (index <= selectedBand) ? buttonHeight * index : buttonHeight * index + selectedBandHeight;
            int height = selectedBand == index ? selectedBandHeight + buttonHeight : buttonHeight;

            // the band dimensions
            bandPanel.Location = new Point(0, vPos);
            bandPanel.Size     = new Size(ClientRectangle.Width, height);

            // the contained button dimensions
            bandPanel.Controls[0].Location = new Point(0, 0);
            bandPanel.Controls[0].Size     = new Size(ClientRectangle.Width, buttonHeight);

            // the contained content panel dimensions
            bandPanel.Controls[1].Location = new Point(0, buttonHeight);
            bandPanel.Controls[1].Size     = new Size(ClientRectangle.Width - 2, height - 8);
        }