views:

74

answers:

2

I am scripting a VB project for class and need to figure out how to calculate a running total number of Click events a button has recieved over the course of the runtime. The project is supposed to display the total number of times that the Calculate total number of times that the "CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click" procedure has been executed over the course of the runtime.

A: 

You need to add a numeric field to your class and increment it when the button is clicked.

If you have any specific questions about how to do this, please ask them directly. (We will not do your homework for you)

SLaks
For tsome reason the Textbook doesn't explain this, that is why i am here asking, i am finished with the project except for this procedure thank you!
EllisDee
@Ellis: Do you know how to make a field in your class? (eg, `Private ClickCount As Integer`)
SLaks
Yeah i just figured out that i was declaring a Local level variable instead of a Module level variable, and it was reseting the variable to zero as a result, instead of establishing a running count. Thanks for all the help!!
EllisDee
A: 

It would be far better to use a Window Performance counter that is incremented when the event handler executed, than a local variable. In this way it can be monitored outside the application.

Preet Sangha
Not for a homework assignment...
SLaks