Boa Noite, gostaria de entender esse erro:
public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void MostraConta() { textoNumero.Text = Convert.ToString(this.conta.Numero); textoSaldo.Text = Convert.ToString(this.conta.Saldo); textoTitular.Text = this.conta.Titular;
}
private Conta conta;
private void Form1_Load(object sender, EventArgs e) { Conta conta = new Conta(); this.conta.Titular = "Victor"; this.conta.Deposita(250.0); this.conta.Numero = 1;
this.MostraConta(); }
private void button1_Click(object sender, EventArgs e) { string ValorDoDep = textValor.Text; double Valor = Convert.ToDouble(ValorDoDep); this.conta.Deposita(Valor);
this.MostraConta();
} }
ERRO: An unhandled exception of type 'System.NullReferenceException' occurred in CaixaEletronico.exe
Additional information: Object reference not set to an instance of an object.