private void addNewAreaItem(string name = "") { if (lastFocus is MyListItem) { MyAreaPanel area = (MyAreaPanel)(((MyListItem)lastFocus).Parent); //MyAreaPanel area = userArea[0]; MyListItem item = new MyListItem(userAreaPanel, false); area.Height += 19; area.items.Add(item.ItemName); area.Controls.Add(item); item.Tb.Focus(); if (name != "") { item.ItemName = name; item.Tb.Text = name; MyInteraction.listClick(item); } } }
/// <summary> /// new area /// </summary> /// <returns></returns> private void addNewArea(string name = "") { MyAreaPanel area; if (name == "") { area = new MyAreaPanel(userAreaPanel); } else { area = new MyAreaPanel(userAreaPanel, name); } userAreaPanel.Controls.Add(area); if (name == "") { area.Tb.Focus(); lastFocus = area.Title; } else { mainform.Focus(); } }