Public Class Change
    Private Sub ButtonBack_Click(sender As Object, e As EventArgs) Handles ButtonBack.Click
        authpanel.Enabled = True
        Me.Close()
    End Sub

    Private Sub ButtonChange_Click(sender As Object, e As EventArgs) Handles ButtonChange.Click
        If TextBoxNewPassword.Text = "0000" Then
            MsgBox("Your password mustn't be '0000'", MsgBoxStyle.Exclamation)
        Else
            If TextBoxCurrentPassword.Text = My.Settings.AuthCode Then
                My.Settings.AuthCode = TextBoxNewPassword.Text
                My.Settings.Save()
                My.Settings.Reload()
                MsgBox("Your password has been successfully changed.")
                authpanel.Enabled = True
                Me.Close()
            Else
                MsgBox("Your current password has been rejected", MsgBoxStyle.Exclamation)
            End If
        End If
    End Sub

    Private Sub Change_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Text = "Change password | " & System.Environment.MachineName
    End Sub
End Class