Public Class Form1
    Dim nr1, nr2 As Integer
    Dim index As Integer = 0
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button2.Enabled = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        nr1 = Val(InputBox("Dati primul numar"))
        nr2 = Val(InputBox("Dati al doilea numar"))
        Button2.Enabled = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        While (index * nr1 + nr2 < 50)
            TextBox1.Text = TextBox1.Text & Str(index * nr1 + nr2) & Chr(13) & Chr(10)
            index += 1
        End While
        If index = 0 Then
            TextBox1.Text = "Nu exista astfel de numere"
        End If
    End Sub
End Class
