Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: VB Picturebox control


20 Jul 2012   #1

Windows 7 Enterprise 64 Bit
 
 
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 System SpecsSystem Spec
.

20 Jul 2012   #2

Win 7 Ultimate x64 desktop, Win 8.1.1 x64 laptop, Win 7 Home x64 netbook, Win 8.1.1 x64 tablet
 
 

My System SpecsSystem Spec
20 Jul 2012   #3

Windows 7 Enterprise 64 Bit
 
 

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 System SpecsSystem Spec
.


Reply

 VB Picturebox control




Thread Tools




Our Sites

Site Links

About Us

Find 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 07:38 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33