title: Is there a break a loop once a button is pressed (Visual basic)
body: <pre><code>            For i = 1 To 10
                  Ascii()
                  ForegroundColor = random.Next(1, 16)
                  DrawSlot(&quot;Unknown&quot;)
                  WriteLine()
                  ForegroundColor = random.Next(1, 16)
                  DrawSlot(&quot;Unknown&quot;)
                  WriteLine()
                  ForegroundColor = random.Next(1, 16)
                  DrawSlot(&quot;Unknown&quot;)
                  Thread.Sleep(100)
                  Clear()
              Next
  </code></pre>
  <p>I want this loop to continue until the user presses a button on their keyboard, causing the loop to end. Using a console.readline causes the program to pause and wait for an input, so I was wondering if there was another way of doing it?</p>