Question Loading an image dynamically?

darrenbooy

Member
Joined
Mar 16, 2009
Messages
8
Programming Experience
Beginner
Hi all,

I want to load picture dynamically within VB.NET and the following code does not work due to 'loadpicture' not existing in VB.NET.

picturebox.image=Loadpicture("tick.jpg")

Does anyone know of an easy solution to this? (sample code would be great).

Thanks :rolleyes:
 
Use the picturebox Load method or ImageLocation property, or load Image.FromFile.
The first two options is easiest to find in help for Picturebox class, the latter in help for Image class.
 
Thats great guys I actually managed to use this:

Me.PictureBox7.Image = New System.Drawing.Bitmap(IO.Path.GetFileName("tick.jpg"))

Why has VB.NET overcomplicated previously simple functions available in VB6 like newindex, loadpicture etc. It is constantly tripping me up!
 
Back
Top