Public Class frmIndex

  Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
    'Display values of index ranging from 0 to n Step s
    Dim n, s As Double
    n = CDbl(txtEnd.Text)
    s = CDbl(txtStep.Text)
    lstValues.Items.Clear()
    For index As Double = 0 To n Step s
      lstValues.Items.Add(index)
    Next
  End Sub

End Class
