You are viewing our Forum Archives. To view or take place in current topics click here.
How do I loop this?
Posted:

How do I loop this?Posted:

StupidSpawn
  • Resident Elite
Status: Offline
Joined: Apr 15, 201212Year Member
Posts: 265
Reputation Power: 10
Status: Offline
Joined: Apr 15, 201212Year Member
Posts: 265
Reputation Power: 10
If My.Computer.Network.Ping("www.google.com") = False Then
Label1.Text = "Not connected to the internet."
Label1.ForeColor = Color.Red
Else
Label1.Text = "Connected to the internet!"
Label1.ForeColor = Color.Green
End If

I want to loop it every second.
#2. Posted:
PSG1
  • TTG Contender
Status: Offline
Joined: May 05, 201113Year Member
Posts: 3,656
Reputation Power: 161
Status: Offline
Joined: May 05, 201113Year Member
Posts: 3,656
Reputation Power: 161
Make a for loop

For (xxxx )

do stuff
#3. Posted:
Z61
  • TTG Fanatic
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
use a timer with a tick of 1000.
#4. Posted:
StupidSpawn
  • Resident Elite
Status: Offline
Joined: Apr 15, 201212Year Member
Posts: 265
Reputation Power: 10
Status: Offline
Joined: Apr 15, 201212Year Member
Posts: 265
Reputation Power: 10
Z61 wrote use a timer with a tick of 1000.

How would I do that? I'm new to VB sorry.
#5. Posted:
AvP_Coding
  • Junior Member
Status: Offline
Joined: Jul 08, 201212Year Member
Posts: 68
Reputation Power: 2
Status: Offline
Joined: Jul 08, 201212Year Member
Posts: 68
Reputation Power: 2
Form1 Load
Timer1.Start


Add a timer to the form
Double click the timer
Timer1.Interval = 1000

Add your code in there
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.