public void AddTitleImage(TitleImage titleImage) { this.flowLayoutPanel1.Controls.Add(titleImage); this.flowLayoutPanel1.Controls.Remove(plusTitleImage); this.flowLayoutPanel1.Controls.Add(plusTitleImage); images.Add(titleImage); titleImage.OnSelected += TitleImageSelected; titleImage.OnRemoved += TitleImageRemoved; titleImage.Selected = true; }
public void TitleImageSelected(TitleImage selectedTitle, EventArgs args) { selectedTitleImage = selectedTitle; foreach (TitleImage item in this.images) { if (item != selectedTitle) { item.Selected = false; } } }
public TitleImageControl() { InitializeComponent(); plusTitleImage = new TitleImage() { Image = plusImage, CannotRemove = true, Selectable = false, }; plusTitleImage.Click += PlusTitleImage_Click; }
public void RemoveTitleImage(TitleImage image) { this.flowLayoutPanel1.Controls.Add(image); }
public void TitleImageRemoved(TitleImage selectedTitle, EventArgs args) { this.images.Remove(selectedTitle); }