I have an old VB6 application which I am reworking to VB.NET and the previous programmer set this sort of thing when validating MaskedTextBox components:
MsgBox("My message")
b = True
myField.Focus()
Basically, a message box is open and if the validation failed the focus should get to other myField text component.
I changed the Enter event to GotFocus and now when the validation fails I am stuck on the current text field forever. I cannot even close the window because of the constant message box that appears.
I fixed the problem on GotFocus by moving the other statements above the MsgBox() command.
Yes it works well now, but really want to understand how does MsgBox affects the execution of the program?