Пример #1
0
        private void BindEvent(StepButton item)
        {
            item.BackColor = C_UNSELECTED_COLOR_BG;

            item.Click      += new EventHandler(item_Click);
            item.MouseDown  += new MouseEventHandler(item_MouseDown);
            item.MouseUp    += new MouseEventHandler(item_MouseUp);
            item.MouseEnter += new EventHandler(item_MouseEnter);
            item.MouseLeave += new EventHandler(item_MouseLeave);
        }
Пример #2
0
        void item_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < List.Count; i++)
            {
                if (List[i].Equals(sender))
                {
                    this[i].BackColor    = C_SELECTED_COLOR_BG;
                    this[i].ForeColor    = C_SELECTED_COLOR_FG;
                    m_selectedStepButton = this[i];
                    m_selectedStepButton.ContentPanel.Visible = true;
                }
                else
                {
                    this[i].BackColor            = C_UNSELECTED_COLOR_BG;
                    this[i].ForeColor            = C_UNSELECTED_COLOR_FG;
                    this[i].ContentPanel.Visible = false;
                }
            }

            m_selectedStepButton.ContentPanel.BringToFront();
            m_selectedStepButton.ContentPanel.Focus();
        }
Пример #3
0
 public void Remove(StepButton item)
 {
     UnBindEvent(item);
     List.Remove(item);
 }
Пример #4
0
 public void Insert(int index, StepButton item)
 {
     BindEvent(item);
     List.Insert(index, item);
 }
Пример #5
0
 public void Add(StepButton item)
 {
     BindEvent(item);
     List.Add(item);
 }