Each time you call
UpdateSignalCountLabel
it updates the labels with the values from your internal variables, and saves them to individual files.
But unless you somewhere read those files and update the values of
signalCountO
and
signalCount1
from them, or otherwise update the variables it will have no effect on your labels.
I'd suggest a change: use the settings file instead: open the Solution pane, open the project branch, then double click "Settings.settings".
In the resulting page, create two new lines named
OCount
and
ICount
, make them both
int
, and leave the scope as
User
. Add a
Value
of 0 for each.
Now in your code, you can load your internal variables in the Form.Load event:
signalCountI = Properties.Settings.Default.ICount
signalCountO = Properties.Settings.Default.OCount
And save them in your Form.Closing event:
Properties.Settings.Default.ICount = signalCountI
Properties.Settings.Default.OCount = signalCountO
Properties.Settings.Default.Save()
And the system will handle it all for you. All you need to do is update
signalCountI
and
signalCountO
when you want to count data in or out, or reset them to zero when you need to.