I have two forms, one inherited from the first, with mostly the same content except for one combobox called cboMedioPago that is unique to the child form. There´s a method that, any time a value changes on the form, changes a final value. In the child form I need to override this method as i need to take into consideration the value of the combobox.
protected override void ActualizarPrecio()
{
float precio = Producto.productos[this.cboListaProductos.SelectedIndex].Precio * (int)numCantidad.Value;
if (cboMedioPago.Text == "Crédito")
{
precio *= (float)1.1;
}
this.lblTotal.Text = "$ " + precio.ToString();
}
The problem is that whenever i call this child form, i get the mentioned error when trying to fetch the value of cboMedioPago.
Im getting this error: 'Object reference not set to an instance of an object.'
How can I fix this?