I am making a windows from using c# and am stumped as to how to count a button click. Any pointers or information would be appreciated.
BlackNinja
0
Newbie Poster
Recommended Answers
Jump to PostCreate a private int within your Form1 class (or could be public, if you needed that) and increment it in your button_Click method.
Jump to PostSince not all routes through your if/else structure assign "path" a value (as your dialog result could theoretically be another value and there is not an else clause for that if), path go unassigned and have no value. In addition, the compiler is complaining that if your clickcounter is odd …
All 8 Replies
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
BlackNinja
0
Newbie Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
bbman
12
Junior Poster
BlackNinja
0
Newbie Poster
BlackNinja
0
Newbie Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
bbman
12
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.