473,221 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Problem with RaiseEvent - Again

ffa
I have a number of classes that declare a public Event called RefreshData:

Public Class Client
Implements INotifyPropertyChanged

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.Prope rtyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Private WithEvents _ValidationRules As New Validation.brokenRules(Me)

<snip>

The event is reaised whenever the class does a data fetch:

<snip>

_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))

_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))

End With

_Memo = New ClientMemo(_DatabaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Client", _ID, _DatabaseName)

RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In any form where this is used it is declared as follows:

Private WithEvents oClient As TRM8.WFL.Client

and is handled as follows:

Private Sub oClient_Refresh() Handles oClient.RefreshData

With oClient

mnuEditClient.Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple checked
my code and all appears well.

Has anyone seen this behaviour before? ....or can offer any suggestions.

Thank you
Sep 24 '07 #1
2 1350
In the debugger, if you put a break point at the RaiseEvent RefreshData
statement, does everything look cool? In other words, when this happens to
me, usually something is going on deeper in the code and the event is never
raised.
"ff*@newsgroup.nospam" wrote:
I have a number of classes that declare a public Event called RefreshData:

Public Class Client
Implements INotifyPropertyChanged

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.Prope rtyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Private WithEvents _ValidationRules As New Validation.brokenRules(Me)

<snip>

The event is reaised whenever the class does a data fetch:

<snip>

_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))

_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))

End With

_Memo = New ClientMemo(_DatabaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Client", _ID, _DatabaseName)

RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In any form where this is used it is declared as follows:

Private WithEvents oClient As TRM8.WFL.Client

and is handled as follows:

Private Sub oClient_Refresh() Handles oClient.RefreshData

With oClient

mnuEditClient.Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple checked
my code and all appears well.

Has anyone seen this behaviour before? ....or can offer any suggestions.

Thank you
Sep 24 '07 #2
ffa
Thanks Mike
Yes, I put a breakpoint where you suggested and the code just jumps to the
next statement in the class method without calling the "oClient_Refresh()
Handles oClient.RefreshData" method. Really wierd

"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:82**********************************@microsof t.com...
In the debugger, if you put a break point at the RaiseEvent RefreshData
statement, does everything look cool? In other words, when this happens
to
me, usually something is going on deeper in the code and the event is
never
raised.
"ff*@newsgroup.nospam" wrote:
>I have a number of classes that declare a public Event called
RefreshData:

Public Class Client
Implements INotifyPropertyChanged

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.Prop ertyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Private WithEvents _ValidationRules As New Validation.brokenRules(Me)

<snip>

The event is reaised whenever the class does a data fetch:

<snip>

_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))

_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))

End With

_Memo = New ClientMemo(_DatabaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Client", _ID, _DatabaseName)

RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In any form where this is used it is declared as follows:

Private WithEvents oClient As TRM8.WFL.Client

and is handled as follows:

Private Sub oClient_Refresh() Handles oClient.RefreshData

With oClient

mnuEditClient.Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple
checked
my code and all appears well.

Has anyone seen this behaviour before? ....or can offer any suggestions.

Thank you

Sep 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Nicolas | last post by:
How do I do a RaiseEvent in csharp I'm ok in VB but csharp confused me a lot. ******* code ******** private FileSystemWatcher watcher = new FileSystemWatcher(); public delegate void...
18
by: Derek Martin | last post by:
Hi there, this is probably really dumb, but I am using a dialog as my main form and my startup form is my splash screen - which implements some progress bars to load up some relevant data. When...
8
by: Scott Meddows | last post by:
I have a datagrid control that I've inherited from the base datagrid control (Source below). I am applying a datatable style onto the datatable that I assign as my datasource. All of my column...
12
by: Ron | last post by:
Greetings, I am trying to understand the rational for Raising Events instead of just calling a sub. Could someone explain the difference between the following 2 scenarios? Why would I want to...
0
by: fiaolle | last post by:
Hi If I click on the new row in my DataGrid, I can see that I have a new row with cells with NULL values. But if I Tab to the new row the same thing doesn't happen, it seems like it isn't a new...
7
by: Onokiyo | last post by:
Hello, I have the code below and somehow the message from RaiseEvent doesn't pop up at all. Can someone help me please? '------CODE '------/form1.vb/VB2005/Framework20--------- Imports...
3
by: Martin | last post by:
Hi all, I'm having a problem when trying to raise an event in my custom control when a toolstripbutton enable state changes. The problem is that although the code to raise the event executes, my...
1
by: Terry Olsen | last post by:
I have a program with a couple of long running processes that i'm calling on a separate thread. When the process is completed, I want to raise an event to tell the main thread that it's done. I...
1
by: msch-prv | last post by:
I would like to raise the selected event of an objectdatasource (ods) to retrieve some data. I tried to raise this event using a server button. I am at a loss as to how set up the RaiseEvent syntax...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.