 <p>Could do with seeing a bit more context, but the following should do what I think you want:</p> <pre><code>Private Sub btnIgnorar_Click(sender As Object, e As EventArgs) Handles btnIgnorar.Click DialogResult = DialogResult.Ignore Close End Sub </code></pre> <p>This will close the dialog and return the associated result code to the caller. As to the original code, it seems a bit strange setting the values in the buttons click handlers?</p>