void Enviar() { if (Input_Produto.Text == "") { return; } if (!Alter) { Produtos.Add(Input_Produto.Text); } else { if (L_Content.SelectedIndex < 0) { Alter = false; return; } ActualAlter = new Alter(L_Content.SelectedIndex, Input_Produto.Text); Produtos[ActualAlter.GetIndex] = ActualAlter.GetProduct; Alter = false; } L_Content.Items.Clear(); SelectProdutos(Produtos); Input_Produto.Text = ""; Input_Produto.Focus(); }
private void But_Alterar_Click(object sender, EventArgs e) { if (L_Content.SelectedIndex < 0) { return; } Input_Produto.Text = Produtos[L_Content.SelectedIndex]; Alter = true; Input_Produto.Focus(); }
private void Form1_Load(object sender, EventArgs e) { Input_Produto.Focus(); }