Hallo Leute,
Wie kann ich per Knopfdrück mehrere Labels erzeugen lassen? Also ein Label pro Buttondruck
Ich habe soweit das hier
Es funktioniert jedoch nur einmal, das erste Label wird angezeigt wie es soll, aber wenn ich danach nochmal auf Button3 drücke, passiert nichts mehr
Wie kann ich per Knopfdrück mehrere Labels erzeugen lassen? Also ein Label pro Buttondruck
Ich habe soweit das hier
VB.NET-Quellcode
- Dim noLabel As Integer = 1
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Dim nLabel As New Label
- nLabel = New Label
- With nLabel
- .Name = noLabel
- .Height = 13
- .Text = "Zone l/min)" & noLabel
- .Left = 200 + noLabel * 10
- .Top = 200 + Rnd(10)
- .Visible = True
- End With
- Controls.Add(nLabel)
- noLabel = noLabel + 1
- End Sub
Es funktioniert jedoch nur einmal, das erste Label wird angezeigt wie es soll, aber wenn ich danach nochmal auf Button3 drücke, passiert nichts mehr