VB silverlight for windows phone “Handles clause requires a WithEvents variable defined in the containing type or one of its base types”

╄→尐↘猪︶ㄣ 提交于 2020-01-03 02:54:11

问题


When I am selecting a button from the .xaml file and then tap event from the right (in order to set the tap event) it auto generates this sub:

Private Sub btn(ByRef sender As Object, e As System.Windows.RoutedEventArgs) Handles btn.Tap

End Sub

But it also has this error:

Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

Any suggestions? Thank you!


回答1:


Public WithEvents btn As Button just above the sub in order to send away the bug !



来源:https://stackoverflow.com/questions/10615710/vb-silverlight-for-windows-phone-handles-clause-requires-a-withevents-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!