在Visual Basic中处理事件 [英] Handling Event in Visual Basic

查看:68
本文介绍了在Visual Basic中处理事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

myNetwork.IterationChanged += New NeuralNetwork(Of 
String).IterationChangedCallBack(neuralNetwork_IterationChanged)



它说不能直接调用它.它需要使用引发事件语句引发事件.有人可以帮我吗?我无法弄清楚如何在Visual Basic中处理事件.



it says that it cannot be called directly. it needs to use raise event statement to raise an event. can someone help me..i cant figure out on how to handle events in visual basic,,

推荐答案

^ ]建议:

MSDN[^] suggests:

AddHandler myNetwork.IterationChanged, AddressOf neuralNetwork_IterationChanged


您似乎不知道该事件是什么.请阅读VB.NET和.NET手册中的事件.事件只能在声明该事件的类中引发.与常规委托实例相比,这是事件的重要限制之一.

您的情况无法解决".您需要说明要达到的目的才能获得一些解决方案的建议.

—SA
It looks like you don''t know what the event is. Please read on events in VB.NET and .NET manual. An event can only be raised in the class where it is declared. This is one of the important limitations of events compared to regular delegate instances.

Your situation cannot be "fixed". You need to explain what you want to achieve to get suggestion on some solution.

—SA


这篇关于在Visual Basic中处理事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆