Hay guys.

I've project where i wanna check if user is connected to internet if he isn't then form must close and another form should show up !

Problem i'm getting is i can't use check it constantly, even if i use while loop

Code:
  
' keep looping the following code until condition is wrong or until connection is made 

        While IsConnectionAvailable() = False

            ' code goes here for when connection to hotflask can't be made.

                Form2.Show()


        End While
but here form 2 keep showing up and it crashes system, is there any simple way to do it !

thanks in advance.