Quote Originally Posted by Joacim Andersson View Post
First of all you only pasted one of the two functions I posted, you need both of them. Secondly you actually also need to call on them.
Is your TextBox a multiline TextBox? Wouldn't a ListBox be better to show the prime numbers?
I will assume that TextBox3 is a multiline textbox and that you want to show one prime number on each line.
Code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  Dim lower, upper As Integer
  If Integer.TryParse(TextBox1.Text, lower) AndAlso Integer.TryParse(TextBox2.Text, upper) Then
    Dim primeNumbers() As Integer = GetPrimeNumbers(lower, upper)
    Dim text As String = ""
    For Each prime As Integer In primeNumbers
      text &= prime.ToString() & vbCrLf
    Next
    TextBox3.Text = text
  End If
End Sub


Thank you very much

This is exactly what I wanted

Have a really good day !