Using f As New Form2() If f.ShowDialog(Me) = DialogResult.OK Then MsgBox("OK") Else MsgBox("Cancel") End If End Using