RaiseEvent Not Firing
Posted on 2007-08-01
I am developing in VB.NET and trying to raise an event that will notify my form when a status changes behind the scenes in the file directory. The code hits the RaiseEvent statement but never raises the event and processes the code I have associated with it. I have attached a sample below...
Public Class StatusFileWatcher
Public Event WatchdogStatusChange()
Private Sub CompareNewToOld()
' Some looping and comparisons are going on here in the beginning
'andt in the middle of the sub the raise event is hit, but not fired
If strName = "Watchdog:" And (cntrlGroupBox.Controls(intGroupChild).Text <> statusFieldNode.InnerText.ToString) Then
'Here is the Form code...
Public Class frmOMARFileManager
Private WithEvents moStatusFileWatcher As StatusFileWatcher
Public Sub moStatus_WatchdogStatusChange() Handles moStatusFileWatcher.WatchdogStatusChange
MessageBox.Show("Watchdog Status Change: ")