Tutorials    Freebies    Links    Feedback    Thank me
Agent Store   Agent Games   Legal notice    History
Home

Intro»»Part 1»»Part 2»»Part 3»»Part 4

The Bookmark event

So, how do we get the spoken text to appear inside the label once Peedy has said it? We use the Agent control's Bookmark event. This has the opening syntax of:

Private Sub Agent1_Bookmark(ByVal BookmarkID As Long)

Using the BookmarkID variable, you can use a Select Case structure to find out what you should change the label's caption to:

Private Sub Agent1_Bookmark(ByVal BookmarkID As Long)
Select Case BookmarkID
Case 100
lblSymbol.Caption = "A"
Case 200
lblSymbol.Caption = "B"
Case 300
lblSymbol.Caption = "C"
Case 400
lblSymbol.Caption = "1"
Case 500
lblSymbol.Caption = "2"
Case 600
lblSymbol.Caption = "3"
Case 700
lblSymbol.Caption = ""
End Select
End Sub

Now, when Peedy speaks, the letters and numbers should appear on screen (although they will still appear in Peedy's speech bubble too (but don't rely on the user having the balloon switched on)).

Intro»»Part 1»»Part 2»»Part 3»»Part 4