Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Null variables been passed

$
0
0

        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.


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>