You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
6.6 KiB

Public Class FrmPasswortWechsel
Inherits System.Windows.Forms.Form
#Region " Vom Windows Form Designer generierter Code "
Public Sub New()
MyBase.New()
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
InitializeComponent()
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
End Sub
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
' Für Windows Form-Designer erforderlich
Private components As System.ComponentModel.IContainer
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
'Sie kann mit dem Windows Form-Designer modifiziert werden.
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents btnAbbruch As System.Windows.Forms.Button
Friend WithEvents btnOK As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmPasswortWechsel))
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.btnAbbruch = New System.Windows.Forms.Button()
Me.btnOK = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(112, 24)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBox1.TabIndex = 0
Me.TextBox1.Text = "TextBox1"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(112, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBox2.TabIndex = 1
Me.TextBox2.Text = "TextBox2"
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(112, 88)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBox3.TabIndex = 2
Me.TextBox3.Text = "TextBox3"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 24)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 3
Me.Label1.Text = "Altes Kennwort"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 56)
Me.Label2.Name = "Label2"
Me.Label2.TabIndex = 4
Me.Label2.Text = "Neues Kennwort"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 88)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(100, 32)
Me.Label3.TabIndex = 5
Me.Label3.Text = "Kennwort-Bestätigung"
'
'btnAbbruch
'
Me.btnAbbruch.Location = New System.Drawing.Point(8, 136)
Me.btnAbbruch.Name = "btnAbbruch"
Me.btnAbbruch.TabIndex = 6
Me.btnAbbruch.Text = "&Abbruch"
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(136, 136)
Me.btnOK.Name = "btnOK"
Me.btnOK.TabIndex = 7
Me.btnOK.Text = "&OK"
'
'FrmPasswortWechsel
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(224, 165)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnOK, Me.btnAbbruch, Me.Label3, Me.Label2, Me.Label1, Me.TextBox3, Me.TextBox2, Me.TextBox1})
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "FrmPasswortWechsel"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "FrmPasswortWechsel"
Me.ResumeLayout(False)
End Sub
#End Region
Dim m_passwort As String
Property Passwort() As String
Get
Return m_passwort
End Get
Set(ByVal Value As String)
m_passwort = Value
End Set
End Property
Private Sub FrmPasswortWechsel_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
Me.TextBox3.Text = ""
Me.TextBox1.Focus()
End Sub
Private Sub btnAbbruch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAbbruch.Click
Me.DialogResult = DialogResult.Abort
Me.Close()
End Sub
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
If Me.TextBox1.Text <> Me.Passwort Then
MsgBox("Das alte Kennwort ist nicht korrekt.", MsgBoxStyle.Critical)
Me.TextBox1.Text = ""
Me.TextBox1.Focus()
Exit Sub
End If
If Me.TextBox2.Text <> Me.TextBox3.Text Then
MsgBox("Das neue Kennwort und die Kennwortbestätigung stimmen nicht überein.", MsgBoxStyle.Critical)
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
Me.TextBox3.Text = ""
Me.TextBox1.Focus()
Exit Sub
End If
If Me.TextBox2.Text.Length < 4 Then
MsgBox("Das neue Kennwort muss mind. 4 Zeichen lang sein.", MsgBoxStyle.Critical)
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
Me.TextBox3.Text = ""
Me.TextBox1.Focus()
Exit Sub
End If
Me.DialogResult = DialogResult.OK
Me.Passwort = Me.TextBox2.Text
Me.Close()
End Sub
End Class