ChangeEventArgs to string

lalvarez

New member
Joined
Mar 20, 2013
Messages
4
Programming Experience
1-3
Hi,
I'm new in this forum. I don't know if this is the right place to post my question, but i'll try it anyway:

In a windows mobile application i have a procedure:
"Private Sub objGprs_Changed(ByVal sender As Object, ByVal args As Microsoft.WindowsMobile.Status.ChangeEventArgs) Handles objGprs.Changed"

and objGrps is:

Public WithEvents objGprs As Microsoft.WindowsMobile.Status.SystemState


I'm trying to guess which is the event that causes the change, so I think I should read "args" content, that is: i need to visualize the name of the event that is changing the SystemState.

How should i proceed?

Thanks in advance.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,347
Location
Sydney, Australia
Programming Experience
10+
Have you read the documentation for the ChangeEventArgs class? That's the logical first step when you want to know anything about a class or member. It will tell you what members the class has and what they are for. Logic suggests that the class has a property that tells you what type of change occurred.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,439
Location
Norway
Programming Experience
10+
This class was new to me two minutes ago, but I looked it up in documentation, here's what I read from it: It appears a SystemState object is initialized for a specific system property, its CurrentValue property returns the current value, and Changed event notifies the new value in e.NewValue property when that property changes.
 

lalvarez

New member
Joined
Mar 20, 2013
Messages
4
Programming Experience
1-3
Finally I have discovered it's property "property" which gives the information about the property which has triggered this event. Thanks anyway!
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,439
Location
Norway
Programming Experience
10+
That is true, if you have various SystemState objects that would raise the event you can get the object that raises the event from the event handlers sender property and check its Property property.
 
Top Bottom