public void New(Panel parent, string title) { XButton button = new XButton(list.Count, parent, title); button.RegisterEvent(Click, On, Leave); list.Add(button); }
private void On(object sender, EventArgs e) { XButton t = (XButton)sender; if (activeItem != t.ID) { t.SetStyle(XStyle.On); } }
private void Click(object sender, EventArgs e) { XButton t = (XButton)sender; activeItem = t.ID; t.SetStyle(XStyle.Active); foreach (XButton item in list) { if (item.ID != t.ID) { item.SetStyle(XStyle.None); } } c.SelectedIndex = t.ID; }