/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="MultimediaScroll"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public MultimediaScroll() { DoubleBuffered = true; // Provides the border _pnl = new SilPanel(); _pnl.Dock = DockStyle.Fill; _pnl.AutoScroll = true; _pnl.VerticalScroll.Visible = true; _pnl.HorizontalScroll.Visible = false; _pnl.BackColor = Color.DarkGray; Controls.Add(_pnl); }
/// ------------------------------------------------------------------------------------ private void SetupPanels() { Tab = new Label(); Tab.BackColor = Color.Transparent; Tab.MouseLeave += m_lblTab_MouseLeave; Tab.MouseEnter += m_lblTab_MouseEnter; Tab.Paint += m_lblTab_Paint; Tab.Click += m_pnlTab_Click; Controls.Add(Tab); m_pnlContainer = new SilPanel(); m_pnlContainer.Padding = new Padding(kContainerPadding); m_pnlContainer.Anchor = AnchorStyles.Top | AnchorStyles.Bottom; m_pnlContainer.Visible = false; m_pnlContainer.MouseMove += m_pnlContainer_MouseMove; m_pnlContainer.MouseDown += m_pnlContainer_MouseDown; m_pnlContainer.MouseUp += m_pnlContainer_MouseUp; LoadSettings(); m_pnlPlaceholder_SizeChanged(null, null); m_slidingIncrement = m_pnlContainer.Width / 5; if (SlideFromLeft) { // When on left side. Anchor |= AnchorStyles.Left; m_pnlContainer.Anchor |= AnchorStyles.Left; Tab.Location = new Point(0, 3); m_leftEdgeWhenClosed = Right - m_pnlContainer.Width; m_leftEdgeWhenOpened = Right; m_sizingRectangle = new Rectangle(m_pnlContainer.Width - kContainerPadding, 0, kContainerPadding, m_pnlContainer.Height); } else { // When on right side. Anchor |= AnchorStyles.Right; m_pnlContainer.Anchor |= AnchorStyles.Right; Tab.Location = new Point(7, 3); m_leftEdgeWhenClosed = Left; m_leftEdgeWhenOpened = Left - m_pnlContainer.Width; m_sizingRectangle = new Rectangle(0, 0, kContainerPadding, m_pnlContainer.Height); } m_pnlContainer.Location = new Point(m_leftEdgeWhenClosed, Top); }