Public Class frmBeispiel

    Private Sub frmBeispiel_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

    End Sub

    Private Sub frmBeispiel_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtZwei.Text = _strUnten
    End Sub


    Public Property Oben() As String
        Get
            Return txtEins.Text
        End Get
        Set(ByVal value As String)
            txtEins.Text = value
        End Set
    End Property

    Private _strUnten As String
    Public Property Unten() As String
        Get
            Return _strUnten
        End Get
        Set(ByVal value As String)
            _strUnten = value
        End Set
    End Property

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.DialogResult = Windows.Forms.DialogResult.OK

        _strUnten = txtZwei.Text
    End Sub

    Private Sub txtEins_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEins.TextChanged, txtZwei.TextChanged

        Dim txtAuslöser As TextBox = CType(sender, TextBox)

        If Not IsNumeric(txtEins.Text) Then
            ErrorProvider1.SetError(txtAuslöser, "Keine Zahl!")
        Else
            ErrorProvider1.Clear()
        End If
    End Sub
End Class