private void ButtonAddGroup_Click(object sender, EventArgs e) { FormGroup FG = new FormGroup(); DialogResult DR = FG.ShowDialog(); if (DR == DialogResult.OK) { Group G = FG.GetGroup(); G.ID = Groups.Count + 1; Groups.Add(G); } }