Public Class Form1
    Private intRandom As New Random  ' zufall
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        CmdZahl.Text = "&Zahl ziehen"
        CmdBeenden.Text = "B&eenden"
        LblZahl.Text = "0"
    End Sub

    Private Sub CmdBeenden_Click(sender As Object, e As EventArgs) Handles CmdBeenden.Click
        Close()
    End Sub

    Private Sub CmdZahl_Click(sender As Object, e As EventArgs) Handles CmdZahl.Click
        Dim intZufallsZahl As Integer
        intZufallsZahl = intRandom.Next(1, 50)  ' 1 bis 49
        LblZahl.Text = CStr(intZufallsZahl)     ' im label anzeigen
    End Sub
End Class
