I have coded the following which works
Public Sub bBetStatus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bBetStatus.Click
GetBetStatus(104604222) 'Call getMUBets
End Sub
Public Sub GetBetStatus(ByVal YourMarket As Integer)
Dim Req As New BFUK.GetMUBetsReq
With Req
.header = oHeaderUK() 'The standard header
.marketId = 104604222 'The market of interest
.betStatus = BFUK.BetStatusEnum.MU 'Return status of matched and unmatched bets
.recordCount = 100 'Max 100 bets
End With
StateCount += 1
BetFairUK.getMUBetsAsync(Req, StateCount) 'Send the request to the API
End Sub
Public Sub BetFairUK_getMUBetsCompleted(ByVal sender As Object, ByVal e As BFUK.getMUBetsCompletedEventArgs) Handles BetFairUK.getMUBetsCompleted
Try
If Not e.Cancelled Then
With e.Result
CheckHeader(.header)
Print("ErrorCode = " & .errorCode.ToString)
If .errorCode = BFUK.GetMUBetsErrorEnum.OK Then
For i = 0 To .bets.Length - 1 'For all bets on the market
With .bets(i)
Print("BetId = " & .betId & " " & .betStatus.ToString & " Price = " & .price & " Size = " & .size)
End With
Next
End If
End With
End If
Catch ex As Exception
Print(ex.Message) 'If problem
End Try
End Sub
which works
but when I try the following, the sub GetBetStatus is accessed but sub BetFairUK_getMUBetsCompleted is not accessed
Public Sub holdbetstatus(ByVal sender As System.Object, ByVal e As System.EventArgs)
GetBetStatus(104604222)
End Sub
The only difference I can see is the Handle statement, but I don't understand its significance.