VB.NET:
Private Sub CMDreturngame_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMDreturngame.Click
Dim gameID As Integer
Dim memberid As Integer
Dim index As Integer = 0
Dim found As Boolean = False
Dim fine As Integer = 0
Dim whoborrows As Member
Dim ontime As Boolean = False
whoborrows = members.getMember(memberid)
[B] ontime = MsgBox("was the game returned on time", vbYesNo)
If ontime = vbNo Then
memberid = MessageBox.Show("Enter the ID of the member")
fine = CInt(InputBox("Enter the fine"))
whoborrows.payFine(fine)[/B]
Else
ontime = True
End If
gameID = CInt(InputBox("Enter the id of the Game"))
While (Not found And index <= loans.loanslist.Count - 1)
If loans.loanslist(index).GetHashCode = gameID Then
found = True
loans.loanslist.Remove(aloan)
Else
index = index + 1
End If
MessageBox.Show("Loan removed")
End While
End Sub
The above is my code. I'm trying to get it to step into the bolded code when I click on no in the messagebox, but it keeps skipping. No idea why as I've wrote another piece of code with similar coding, which works perfectly fine.
Any help will be much appreciated