public PanelText() { m_IconPanel = null;//2017/01/09 m_PanelIcon = null; bckgColor = BackColor; MouseLeave += new EventHandler(OnMouseLeave); MouseMove += new MouseEventHandler(OnMouseMove); }
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); IconPanel IP = (IconPanel)bandPanel.Controls[1]; IP.resetPanelTextBackColor(1);//2016/01/08 避免系統反應太慢,造成畫面出現一個以上的選擇UI }
public PanelIcon(IconPanel parent, Image image, int index, int size, int Height, int Placed = 0) { this.index = index; this.iconPanel = parent; Image = image; Visible = true; if (Placed == 0) { Location = new Point(iconPanel.outlookBar.Size.Width / 2 - image.Size.Width / 2, iconPanel.Margin + size * iconPanel.IconSpacing + Height); } else { Location = new Point(0, iconPanel.Margin + size * iconPanel.IconSpacing + Height); } Size = image.Size; //Click += onClickEvent; Tag = this; bckgColor = iconPanel.BackColor; this.BorderStyle = System.Windows.Forms.BorderStyle.None;//2016/01/08 }