VB.NET Click Handler Error
I have the following code:
CType(epuc, PropSoftware.SimpleUIControls.GenericPaymentControl).clickEvent = New EventHandler(AddressOf BtnAccept_Click)
and the following handler
Public Sub BtnAcc开发者_JS百科ept_Click(ByVal sender As Object, ByVal e As EventArgs)
But when I click the button, I'm not getting any response...which means the click event is not being triggered. Any idea why?
You need to use AddHandler.
http://msdn.microsoft.com/en-us/library/7taxzxka(v=vs.80).aspx#Y158
or WithEvents + Handles
http://msdn.microsoft.com/en-us/library/6k46st1y(v=VS.90).aspx
Use Addhandler:
AddHandler CType(epuc, PropSoftware.SimpleUIControls.GenericPaymentControl).clickEvent, AddressOf BtnAccept_Click
精彩评论