Public Class frmBonitaetBearbeiten

    Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
        If Not IsNumeric(lblBonitaet.Text) Then DialogResult = Windows.Forms.DialogResult.None : Exit Sub
        If lblBonitaetsdatum.ForeColor = Color.Red Then DialogResult = Windows.Forms.DialogResult.None : Exit Sub
        If Not IsDate(lblBonitaetsdatum._value) Then DialogResult = Windows.Forms.DialogResult.None : Exit Sub
    End Sub

    Private Sub frmBonitaetBearbeiten_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
        lblBonitaetsdatum._value = Now.ToShortDateString
        lblBonitaet.Focus()
    End Sub

    Private Sub lblBonitaet_KeyDown(sender As Object, e As KeyEventArgs) Handles lblBonitaet.KeyDown, lblBonitaetsdatum.KeyDown
        If e.KeyCode = Keys.Return Then
            btnOK.PerformClick()
        End If
    End Sub

End Class