VB.NET Weather Viewer
Posted: Thu Jan 21, 2010 6:48 pm
ok so I have a new v2 app (v2 meening tested and released in my own language). All it does is uses a picturebox and gets the latest image from sat24.com. So here's the tutorial, and you may notice I do everything in steps it's more fun that way :lol:.
Ok so here we go
Part I - Setup
ok add the following:
ok so now add this to the code for form 1
Updates are now coming to: www.rocky4126.myfastforum.org. All updates posted by users:
Operator
egg1321
rocky4126
Ok so here we go
Part I - Setup
ok add the following:
- form1
picturebox1
timer1
ok so now add this to the code for form 1
Code: Select all
add this to the code for timer1 or just keep on that page!
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start() 'This starts the timer so that the picture can change.
Me.AutoSize = True 'This makes it so that form1(Me) changes its size to suit the contents
If My.Computer.Network.IsAvailable = False Then 'this checks to see if the network is available, if it is disabled then this will show
MsgBox("Please check your network connection or contact your adminsistrator. If used in a school then your network may be down or disabled. in this case please contact your technicians or tell your teacher.", MsgBoxStyle.OkOnly, "Network: OFFLINE") 'This creates a one-time instance (messagebox or msgbox) then displays text as a string etc.
End If 'this ends the if function above.
End Sub
Code: Select all
[hr] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.ImageLocation = "http://www.sat24.com/image.ashx?country=eu&type=slide&index=1&sat" 'this gets the picture from a site, in our case sat24.com. If you want feel free to change it!
If My.Computer.Network.IsAvailable = True Then 'this is same as the other one we did but instead it checks to see if there IS a connection to establish
Me.Text = "real-time weather updater 15 min updater - " & Date.UtcNow & " Weather is online " & "data supplied by: www.sat24.com" 'if it is a true network then this will show on the top of the form
Else 'if the above is not true then it will try this vv
Me.Text = "real-time weather updater 15 min updater - " & Date.UtcNow & " Warning: Weather offline!" 'changes the title to this
End If
End Sub
Updates are now coming to: www.rocky4126.myfastforum.org. All updates posted by users:
Operator
egg1321
rocky4126