private void button1_Click(object sender, EventArgs e)
{
_AddExp = new AddExpense();
DialogResult DR = _AddExp.ShowDialog();
if (DR == DialogResult.OK)
{
AddItem();
AddList();
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
public void AddList()
{
foreach (var item in _AddExpList)
{
listBox1.Items.Add(item);
}
}
public void AddItem()
{
_AddExp = new AddExpense(_AddExp.GetItem, _AddExp.GetPrice);
_AddExpList.Add(_AddExp);
}
The item and price been passed back are null but I have no idea why.