I keep forgetting this but when you show a form via Showdialog you can check to see how that form was closed via something like this:
If Form1.ShowDialog() = Windows.Forms.DialogResult.OK Then
....
End if
However when you do this in your Form1 you will need to specify the Dialog Result with something like this:
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Me.Close()
Me.DialogResult = Windows.Forms.DialogResult.OK
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.Close()
Me.DialogResult = Windows.Forms.DialogResult.Cancel
End Sub
More info (barely) can be found here : http://msdn.microsoft.com/en-us/library/ms745820.aspx
Friday, June 19, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment