private void AddNewItems2() { panel = flowLayoutPanel; int panelHeight = 0; flowLayoutPanel.Controls.Clear(); this.Name = "Show"; Item_ShowDataItems Beschreibung = new Item_ShowDataItems(rootItem, this, description, ItemWidth); panelHeight += Beschreibung.Height + itemSpace; flowLayoutPanel.Controls.Add(Beschreibung); int count = 1; for (int i = 0; i < rootItem.dataCollection.Data.Count; i++) { Item_ShowDataItems NewItem = new Item_ShowDataItems(rootItem, this, i, ItemWidth); NewItem.OrderVisible = rootItem.OrderVisible; panelHeight += NewItem.Height + itemSpace; flowLayoutPanel.Controls.Add(NewItem); count++; } this.Height = panelHeight; }
private void AddNewItems() { panel = flowLayoutPanel; int panelHeight = 0; flowLayoutPanel.Controls.Clear(); this.Name = "Show"; Data description_item = new Data(new MouseData(), new KeyboardData()); description_item.Name = description; Item_ShowDataItems Beschreibung = new Item_ShowDataItems(description_item, -1, ItemWidth, this, rootItem); panelHeight += Beschreibung.Height + itemSpace; flowLayoutPanel.Controls.Add(Beschreibung); int count = 1; foreach (Data d in _data) { Item_ShowDataItems NewItem = new Item_ShowDataItems(d, count, ItemWidth, this, rootItem); NewItem.OrderVisible = rootItem.OrderVisible; panelHeight += NewItem.Height + itemSpace; flowLayoutPanel.Controls.Add(NewItem); count++; } this.Height = panelHeight; }
private void ReOrder() { int itemLength = itemPanel.Controls.Count; for (int i = 0; i < itemLength; i++) { Item_ShowDataItems data = (Item_ShowDataItems)itemPanel.Controls[i]; if (data.Order > _Order) { data.Order--; } } }
private void RemoveItem2() { int itemLength = itemPanel.Controls.Count; for (int i = 0; i < itemLength; i++) { Item_ShowDataItems data = (Item_ShowDataItems)itemPanel.Controls[i]; if (data.Pointer > _pointer) { data.Pointer--; } } itemPanel.Controls.RemoveAt(_pointer + 1); rootItem.dataCollection.Data.RemoveAt(_pointer); ReOrder(); childItem.ReDrawBoders(); }