c# - Int won't increment by 1 -


i'm trying increment value of int: counter 1 each time stakebtn pressed.

here's i've tried far:

private void stakebtn_click(object sender, eventargs e) {   int counter = 0;   counter++;   currentstakes.text = counter.tostring(); } 

however, works 1 time- currentstakes label not go above 1.

is able see going wrong?

obviously, increase 1 time, declare outside click,

int counter = 0;  private void stakebtn_click(object sender, eventargs e) {    counter++;   currentstakes.text = counter.tostring(); } 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -