Alex Craig Alex Craig - 1 year ago 76
C# Question

Adding values in Windows Form?

I have an app I am making and the issue is when I press the Plus button it will add $100 when I press it again nothing happens and I am unsure of a fix, here is the code I'm using.

GlobalVariables.LukasGrahamTotal = +100;
lblLukas.Text = Convert.ToString(GlobalVariables.LukasGrahamTotal);

Answer Source

I don't know if this is just a typo but the short form of increment by some value operator is not =+ but it is +=.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download