Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How can I use the event for a dimmed variable that is NOT a control.
This is my dimmed variable:

VB
Dim engine As New Speech.Recognition.SpeechRecognitionEngine

I want to use the event "engine.SpeechRecognized".
Posted
Comments
Sergey Alexandrovich Kryukov 2-Jul-12 18:42pm    
Speech recognition has nothing to do with controls...
You add the event handler to event's invocation list, and this even it the event of the engine.
--SA

Wire it up to the evnethandler with AddHandler[^].
 
Share this answer
 
Look at the "Handling Events (dynamic)" section of this article to see how to do this:

Step by Step: Event handling in VB.NET[^]

Basically, it would look like this:

VB
AddHandler engine.SpeechRecognized, AddressOf Me.HandleSpeechRecognized


You would then need to have a Sub to handle the event, like so:

VB
Public Sub HandleSpeechRecognized(ByVal sender As Object, _
           ByVal e As System.EventArgs)
    'Your code here
End Sub
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900