Hi i am using WebClient do download a picture/image. The code I am using is:

VB Code:
  1. Dim m1(-1) As Byte
  2.         Dim url As String = "urlhere"
  3.         Dim dbyte As New System.Net.WebClient
  4.        
  5.         dbyte.Headers.Add("Cookie", CookieString)
  6.  
  7.         Dim memstream As New System.IO.MemoryStream
  8.  
  9.         m1 = dbyte.DownloadData(url)
  10.         memstream.Write(m1, 0, m1.Length)
  11.         PictureBox1.Image = Image.FromStream(memstream)
  12.         PictureBox1.Size = PictureBox1.Image.Size
  13.         PictureBox1.Refresh()

If I load up my app, and use this code, it will freeze for about 5-10 seconds and then download the image and display it fine. If I continue using the code it will work fine and download the image normally without freezing.

Can anyone help me stop it from freezing the first time it is used? Thanks