Get Event Argument Value

S

shapper

Hello,

I have a custom control which has an event named Update:

Private Sub MyControl_Update(ByVal sender As Object, ByVal e As
EventArgs)
Dim MyControl As Form = CType(sender, Form)
End Sub

I am trying to get a property called "Name" from "e" EventArgs.

The "e" is custom and inherits from EventArgs. I debugged it and "e"
shows as follows:

e {FormButtonClickEventArgs} System.EventArgs

FormButtonClickEventArgs {FormButtonClickEventArgs}
FormButtonClickEventArgs
_Name "Save" String
+ Empty {System.EventArgs} System.EventArgs
Name "Save" String

So I need to get the value "Save".

How can I do this?

Thanks,

Miguel
 
A

Anthony Jones

shapper said:
Hello,

I have a custom control which has an event named Update:

Private Sub MyControl_Update(ByVal sender As Object, ByVal e As
EventArgs)
Dim MyControl As Form = CType(sender, Form)
End Sub

I am trying to get a property called "Name" from "e" EventArgs.

The "e" is custom and inherits from EventArgs. I debugged it and "e"
shows as follows:

e {FormButtonClickEventArgs} System.EventArgs

FormButtonClickEventArgs {FormButtonClickEventArgs}
FormButtonClickEventArgs
_Name "Save" String
+ Empty {System.EventArgs} System.EventArgs
Name "Save" String

So I need to get the value "Save".

How can I do this?

Why not change the signature to use:-

ByVal e As FormButtonClickEventArgs

since that is the specific type of e. You can then access e.Name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top