VB.NET Weather Viewer

Posts 113 of 13 · Page 1 of 1
VB.NET Weather Viewer
Heres mah tut on how to make a weather viewer
ok add the following to a form:
picturebox1
timer1
ok so now add this to the code for form 1
Code:
    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
add this to the code for timer1:
Code:
    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
Also: may want to dock picturebox1 to fill the form as the pic that it gets from sat24 is quite large
Final Product:
Quote Originally Posted by deathninjak0 View Post
good tut
Thanks bro
Quote Originally Posted by XGelite View Post
boss .
Thanks?
Very Nice Bomb
Quote Originally Posted by NextGen1 View Post
Very Nice Bomb
Thanks nextgen
I like using smaller pictures for weather viewers, like this type:
[img]http://learningwithcomputers.*******.com/f/weather%20widget.jpg[/img]

(Just something I found on the internet)
Quote Originally Posted by Lolland View Post
I like using smaller pictures for weather viewers, like this type:
[img]http://learningwithcomputers.*******.com/f/weather%20widget.jpg[/img]

(Just something I found on the internet)
Can you get that tho
You can get something like it.

I found a site a bit back that used html code to make a 100 x 60 px banner displaying weather, which I found convenient.
Quote Originally Posted by Lolland View Post
You can get something like it.

I found a site a bit back that used html code to make a 100 x 60 px banner displaying weather, which I found convenient.
Maybe share it with us
Looks nice, thanked


And Google sidebar and that Microsoft sidebar have something like lolland's picture.
Quote Originally Posted by |-|3|_][({}PT3R12 View Post
Looks nice, thanked


And Google sidebar and that Microsoft sidebar have something like lolland's picture.
Thanks for the thanks and also, if you could find the image location of lollands picture, then you could use that instead of mah picture
Pretty easy, but nice little program .

Also, its nice to see something with comments. Not just "here tke tis cod and copy paste it. done".
Posts 113 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?