//Добавление обьекта private void btn_new_obj_Click(object sender, EventArgs e) { Form add = new frm_add(); add.Owner = this; add.ShowDialog(); if (add.DialogResult == System.Windows.Forms.DialogResult.OK) { ObjectPOS[] temp = objectp; Array.Resize(ref temp, temp.Length + 1); temp[number_of_objects] = new ObjectPOS(); temp[number_of_objects].name = tmp; temp[number_of_objects].pos_number = 0; objectp = temp; number_of_objects++; } lst_objects.Items.Clear(); for (int i = 0; i < number_of_objects; i++) { lst_objects.Items.Add(objectp[i].name); } lst_objects.Focus(); lst_objects.SelectedIndex = 0; }
//Добавление поса private void btn_new_pos_Click(object sender, EventArgs e) { Form add = new frm_add(); add.Owner = this; add.ShowDialog(); if (add.DialogResult == System.Windows.Forms.DialogResult.OK) { objectp[lst_objects.SelectedIndex].add_addr(tmp); } lst_pos.Items.Clear(); lst_pos.Items.AddRange(objectp[lst_objects.SelectedIndex].pos); }