After some changes, my application started to behave unexpectedly: login form displayed as
If DialogResult.OK <> New frmLogin().ShowDialog() Then ...
is automatically closing itself when line marked as 'problem
is included. If I comment in out, it keeps itself open (as it worked before changes) until I call Me.Close()
manually.
Private Sub Login_Click()
If My.Application.appSession.ID > 0 Then
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
Else
Me.DialogResult = Windows.Forms.DialogResult.Abort 'problem
MsgBox("Invalid user name or password.", MsgBoxStyle.Critical)
End If
End Sub
Did you observe described behavior, that purely setting value of DialogResult
property closes the dialog?