[RESOLVED] DialogResult Problem
Hi all,
im having a problem using the dialogresult. I have 2 forms, frm1 and frm2. frm1 is the main form and frm is another window that will popup and ask the user to save. So when the user hits the back button it will return dialogresult to frm1.
here is the code:
Frm1
VB Code:
Dim l_result As DialogResult
l_result = l_frm2.ShowDialog(Me)
'here l_result is always DialogResult.None
Frm2
VB Code:
Private Sub btBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btBack.Click
If m_settings Is Nothing Then
DialogResult = DialogResult.Cancel
Else
DialogResult = DialogResult.OK
End If
If m_Saved = True Then
Me.Close()
Me.Dispose()
Else
If MsgBox("Exit without saving?", MsgBoxStyle.YesNo, "") = MsgBoxResult.Yes Then
Me.Close()
Me.Dispose()
End If
End If
End Sub
is the me.dispose causing the problem??