VB Picturebox control


  1. Posts : 99
    Windows 7 Enterprise 64 Bit
       #1

    VB Picturebox control


    Hi, is there way to change the picture box image when pressed a button?

    Something like this:

    PictureBox1.Image = (Pic.png)

    This crashed the application:

    PictureBox1.Image = System.Drawing.Bitmap.FromFile(Pic.png)

    Thanks.
      My Computer


  2. Posts : 3,371
    W10 Pro desktop, W11 laptop, W11 Pro tablet (all 64-bit)
       #2
      My Computer


  3. Posts : 99
    Windows 7 Enterprise 64 Bit
    Thread Starter
       #3

    Thanks

    but
    PictureBox1.Image = Image.FromFile _ (System.Environment.GetFolderPath _ (System.Environment.SpecialFolder.Personal) _ & "\Image.gif")

    I dont know what to type into this...

    Edit: It works! i used: picturebox1.image = Projectname.My.Resources.Resources.Imagename
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:09.
Find Us