This is sort of an expansion on the issue I was haveing with the timer. I got the timer to work now I have an issue if the form isn't in focus (say the screensaver kicked on or you bring up another program or something) then the code crashes.
When the timer expires it calls this sub
Shared Sub CheckStatus(ByVal State As Object)
Dim myform As Form
myform = frmMain.ActiveForm
myform.Activate()
myform.Refresh()
'MessageBox.Show("I am refreshed")
myform = Nothing
End Sub
the problem is if frmMain is not the active form then myform doesn't get set and crashes when it tries to refresh it.
My question is how can I test if frmMain is active and if it is refresh it if not go on doing whatever?
Thanks
To go where no programmer has gone before.
When the timer expires it calls this sub
Shared Sub CheckStatus(ByVal State As Object)
Dim myform As Form
myform = frmMain.ActiveForm
myform.Activate()
myform.Refresh()
'MessageBox.Show("I am refreshed")
myform = Nothing
End Sub
the problem is if frmMain is not the active form then myform doesn't get set and crashes when it tries to refresh it.
My question is how can I test if frmMain is active and if it is refresh it if not go on doing whatever?
Thanks
To go where no programmer has gone before.