private void btnAceptar_Click(object sender, EventArgs e) { Tempera t = new entidades.Tempera((ConsoleColor)Enum.Parse(typeof(ConsoleColor), cboxColor.Text), txtMarca.Text, int.Parse(txtCantidad.Text)); MessageBox.Show(t); this.DialogResult = DialogResult.OK; }
public frmTempera(entidades.Tempera tempera1) { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; this.txtMarca.Text = tempera1.GetMarca; this.txtCantidad.Text = tempera1.GetCantidad.ToString(); this.cboxColor.DropDownStyle = ComboBoxStyle.DropDownList; foreach (ConsoleColor color in Enum.GetValues(typeof(ConsoleColor))) { cboxColor.Items.Add(color); } this.cboxColor.Text = tempera1.GetColor.ToString(); }