public MainForm() { InitializeComponent(); item_ = new Item("", 0, 0); items = new List <Item>(); addForm = new AddForm(items, LstVw); btn_Task.Enabled = false; GrVw.RowCount = 3; GrVw[0, 0].Value = "Макс. стоимость"; GrVw[0, 1].Value = "Вес"; GrVw[0, 2].Value = "Время"; }
private void btn_add_Click(object sender, EventArgs e) { if (addForm.IsDisposed) { addForm = new AddForm(items, LstVw); } if (!addForm.Visible) { addForm.Show(); } if (items != null) { btn_Task.Enabled = true; } }