Seems I am having issues with this. When the program starts, the values are initialized with 0 and will be displayed in the text boxes. I can initialize with any value, and it will be shown.
However, the issue is, I cannot get the values to change.
in the class I have some like this:
private int _total_bills;
private int _total_usd;
//Count how much money there is
public int total_usd
{
get { return _total_usd; }
set { _total_usd = value; }
}
// count total number of bills
public int total_bills; {
get { return _total_bills; }
set { _total_bills = value; }
}
public Handler(int tusd, int tb)
{_total_usd = tusd;
_total_bills = tb;
}
public Handler()
{_total_usd = 0;
_total_bills = 0;
}
switch (money){
case 20:
total_usd_ = total_usd + 20;
total_bills++;
break;}
In the form1 I have something like this:
txtBoxTotalUSD.Text = ClassObjectName.total_usd.ToString();
txtBoxTotalBills.Text = ClassObjectName.total_bills.ToString();
Thanks for any guidance!
EDIT: For those wondering if the switch and case are matching..yes they are, as there are other statements in the case which have nothing to do with the displaying, or handling of numbers. They are functioning as expected when the case is matched.