Public Class frmRoutenAuswahlDetails


    Dim ZOLLAEMTER As List(Of VERAG_PROG_ALLGEMEIN.MyListItem)
    Public ZA As String = ""

    Sub New(lbl As String, ZOLLAEMTER As List(Of VERAG_PROG_ALLGEMEIN.MyListItem))

        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()
        Me.ZOLLAEMTER = ZOLLAEMTER
        Me.lblText.Text = lbl
        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.

    End Sub


    Private Sub frmRoutenAuswahlDetails_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.Height = 45
        Dim buttonheight = 0
        MyFlowLayoutPanel1.Controls.Clear()
        For Each z In ZOLLAEMTER
            Dim b As New Button
            b.FlatStyle = FlatStyle.Flat
            b.Size = New Size(328, 72)
            b.BackColor = Color.White
            b.ForeColor = Color.Black
            b.Text = z.Text & vbNewLine & z.Value
            b.Tag = z.Value
            b.DialogResult = Windows.Forms.DialogResult.OK
            buttonheight += b.Height + 2
            AddHandler b.Click, Sub()
                                    Me.ZA = b.Tag
                                    Me.Close()
                                End Sub
            MyFlowLayoutPanel1.Controls.Add(b)
        Next
        Me.Height += buttonheight
    End Sub
End Class