473,738 Members | 6,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with RaiseEvent - Again

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

Public Class Client
Implements INotifyProperty Changed

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged (ByVal sender As Object, ByVal e As
System.Componen tModel.Property ChangedEventArg s) Implements
System.Componen tModel.INotifyP ropertyChanged. PropertyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

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

Private WithEvents _ValidationRule s As New Validation.brok enRules(Me)

<snip>

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

<snip>

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

_Operator_ID = CInt(IfNull(.It em("Operator_ID "), 0))

End With

_Memo = New ClientMemo(_Dat abaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Cli ent", _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.Refresh Data

With oClient

mnuEditClient.E nabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refres h" 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 1381
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 INotifyProperty Changed

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged (ByVal sender As Object, ByVal e As
System.Componen tModel.Property ChangedEventArg s) Implements
System.Componen tModel.INotifyP ropertyChanged. PropertyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

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

Private WithEvents _ValidationRule s As New Validation.brok enRules(Me)

<snip>

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

<snip>

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

_Operator_ID = CInt(IfNull(.It em("Operator_ID "), 0))

End With

_Memo = New ClientMemo(_Dat abaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Cli ent", _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.Refresh Data

With oClient

mnuEditClient.E nabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refres h" 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_Refres h()
Handles oClient.Refresh Data" method. Really wierd

"Family Tree Mike" <Fa************ @discussions.mi crosoft.comwrot e in
message news:82******** *************** ***********@mic rosoft.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 INotifyProperty Changed

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged (ByVal sender As Object, ByVal e As
System.Compone ntModel.Propert yChangedEventAr gs) Implements
System.Compone ntModel.INotify PropertyChanged .PropertyChange d

Public Event ErrorMsg(ByVal ErrMsg As String)

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

Private WithEvents _ValidationRule s As New Validation.brok enRules(Me)

<snip>

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

<snip>

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

_Operator_ID = CInt(IfNull(.It em("Operator_ID "), 0))

End With

_Memo = New ClientMemo(_Dat abaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Cli ent", _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.Refresh Data

With oClient

mnuEditClient. Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refres h" 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
10105
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 Changed(WatcherChangeTypes exch); public delegate void Created(string fileName); public delegate void ReCreated(string OldName, string newName); public delegate void OverRun(string Message);
18
1803
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 that is done, loading form does this: Me.Visible = False mainform.ShowDialog() Application.Exit() So far so good (is this a dumb way of doing that???). Now, I am
8
1551
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 but one are set as readonly=true. The writeable column does not update when I'm editing it. Is there something different that I need to be doing to update this data? Also, how do I get the "new row" to not appear at the bottom of the datagrid?...
12
7090
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 raise an event instead of just calling the sub? Scenario1 -- Using Events ------------------------------------------------------ Public Class Form1
0
788
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 row. And I want the to be able to Tab to a new row. Can I raiseevent to event myGrid_Click so the same thing happens as if a user clicks the new row. If I can do so, please tell me how if I can't please tell me what to do instead. I have tried to...
7
6536
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 System
3
1762
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 handler never see it. This executes when the button enable state changes:- Private Sub OnPrintToolStripButton_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs)Handles PrintToolStripButton.EnabledChanged
1
2048
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 set it up this way... Public Class frmLongRunningProcess Public Enum Proc ParseZipFiles = 0
1
1113
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 arguments. Question: is it possible to call this event from a button server control? Thanks for any pointers. I tried variations of the following:
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8208
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.