How to change a pic??

i put like this
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)     Handles Button1.Click
      
     PictureBox1.Image = "1.JPEG"
        Label1.Text = "what text"

    End Sub

when i clck this button, the text "what text" will appear. but the picture stil can;t be display.
the error showed is " value of  type string cannot be converted to 'System.Drawing.Image'"

May i know what happen>



Answer this question

How to change a pic??

  • Jason-Massey

    Thank u .silkKeng. it work


  • Rod at Work

    Picturebox1.Load("c:\temp\h.jpg")

     

    Happy viewing



  • RenRen le casseur

    If you are using vs2003, try this
    PictureBox1.Image = Image.FromFile("C:\sample.gif")
    But, please make sure your image is not blank image, or else you have streamOutOfMemory exception.

  • okipatrick

    Reneec version is vs2005 in .NET Framework 2. That's why you can't find the .Load method on picturebox control.

  • How to change a pic??