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 2 1357
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |