As a follow up to: access values within custom eventargs class
How do I access public variables within custom Eventargs class, using button click or any other method?
You can't do that. The EventArgs
of the Click
event is always of type EventArgs
; you can't expect it to be of type TraderEventArgs
, because the event args is created by the button, and the button doesn't know anything about TraderEventArgs
. The only way it could work is if you create your own Button
control that raises the event with a TraderEventArgs
instead of an EventArgs