0
我正在做一些轉換編碼,使用找到的.net轉換庫@http://code.google.com/p/dot-net-transitions/。我正在嘗試添加一個事件來觸發已完成的轉換。在我的子,我有以下語句:爲什麼我的活動沒有開火?
Private Sub btnLogin_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
If md5Password = rtnPassHash Then
AddHandler Me.TransitionCompletedEvent, AddressOf theHandlerFunction
Dim tr_empID = New Transition(New TransitionType_Linear(500))
tr_empid.add(txtEmployeeID, "BackColor", Color.LightGreen)
Dim tr_passw = New Transition(New TransitionType_Linear(500))
tr_passw.add(txtPassword, "BackColor", Color.LightGreen)
tr_empID.run()
tr_passw.run()
AddHandler Me.TransitionCompletedEvent, AddressOf theHandlerFunction
Dim tr_empID = New Transition(New TransitionType_Linear(500))
tr_empid.add(txtEmployeeID, "BackColor", Color.LightGreen)
Dim tr_passw = New Transition(New TransitionType_Linear(500))
tr_passw.add(txtPassword, "BackColor", Color.LightGreen)
tr_empID.run()
tr_passw.run()
end if
end sub
該子我之外:
Public Event TransitionCompletedEvent As EventHandler(Of Transition.Args)
Private Sub theHandlerFunction(ByVal sender As Object, ByVal args As Transition.Args) Handles Me.TransitionCompletedEvent
MsgBox("Event Fired")
End Sub
但是,事件沒有在過渡完成後射擊。爲什麼會這樣?
的代碼是什麼'在AddHandler'線?它是在事件處理程序還是其他東西?你可以發佈第一個代碼清單的整個方法嗎? –
我加了一點以上,它是在一個使用按鈕點擊。處理程序是在我的md5匹配條件之後添加的,理論上應該在轉換完成後觸發。 –
'Addhandler'連接事件不會觸發事件。 – OneFineDay