K
KCT
The following class member function (DataClass.DataUpdate) is called by an
event handler at periodic intervals. I want to increment the counter
(Counter) each time it's called, but I don't know how to keep the variable
from being re-set to zero each time the class member function is called.
public class DataClass
{
public static void DataUpdate(Form1 frm)
{
int Counter = 0;
Counter++;
// code here to update a field on the form
}
}
I realize this is a very basic question. Any help would be greatly
appreciated.
event handler at periodic intervals. I want to increment the counter
(Counter) each time it's called, but I don't know how to keep the variable
from being re-set to zero each time the class member function is called.
public class DataClass
{
public static void DataUpdate(Form1 frm)
{
int Counter = 0;
Counter++;
// code here to update a field on the form
}
}
I realize this is a very basic question. Any help would be greatly
appreciated.