Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Opening a Form as a Dialog

$
0
0
Hi everyone,

I have a login form that opens the change password form if certain criteria are met. The new change password form opens and has three text boxes. If for instance a user forgets to enter their new password or their password doesn't match a message box stating what the user did wrong. However, after they click Ok on these message the original login form continues to proceed. How do I prevent it from auto closing the change password form if a message box pops up etc. If I run the change password form separately it works without issues, it is only when I open it from the Login Form.

Below is the code for opening the change password form from the login form.

Code:

                        If passwordReset = "1" Then
                            MsgBox("Your password has been reset. Please enter a new password.", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, projectName & " Login")

                            If changePassword.ShowDialog() = Windows.Forms.DialogResult.Yes Then
                                success = True
                            Else
                                success = False
                            End If

                        End If


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>