Application.idle

  • Thread starter Thread starter sbcglobal
  • Start date Start date
S

sbcglobal

Anyone knows how to add an Application.Idle handler in VB .Net

Private WithEvents ?????????? As ????????

Public Sub IdleEvent(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Application.Idle
Application.DoEvents()

End Sub


Thanks
 
sbcglobal said:
Anyone knows how to add an Application.Idle handler in VB .Net

A handler is added by using AddHandler.
Private WithEvents ?????????? As ????????

Public Sub IdleEvent(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Application.Idle
Application.DoEvents()

End Sub

- Remove "Handles ..."
- Execute
Addhandler application.idle, addressof IdleEvent


FMI: Is it necessary to call Application.DoEvents in the Idle handler?
 
* "sbcglobal said:
Anyone knows how to add an Application.Idle handler in VB .Net

Private WithEvents ?????????? As ????????

Skip the line above and use this instead:

\\\
AddHandler Application.Idle, AddressOf IdleEvent
///
Public Sub IdleEvent(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Application.Idle
Application.DoEvents()

End Sub

What sense does the code above make?
 
Back
Top