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:
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.
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:
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
For (xxxx )
do stuff
- 0useful
- 0not useful
#3. Posted:
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.
- 0useful
- 0not useful
#4. Posted:
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.
- 0useful
- 0not useful
#5. Posted:
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
Timer1.Start
Add a timer to the form
Double click the timer
Timer1.Interval = 1000
Add your code in there
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.