By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Loading an Image in a Picture Box once a Selection has been made from a List Box

P: 1
I am writing a program with 2 forms, a student form with a list box that lists available students and a grade entry form that loads the should load the students pic in a picture box and name in a text box when the student is selected from form one list box. This is my first time trying this and I am not sure I understand where images should be stored or even which filename I should be using to create this event. I was trying :


Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim studentfile As String = frmStudents.lstStudents.SelectedItem & (".jpg")
picstudentPic.Image = Image.FromFile("C:\Users\etten\OneDrive\Documents\ Visual Studio 2012\Projects\Final Project\Final Project\bin\Release") but keep getting an error at runtime : An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Drawing.dll

Additional information: C:\Users\etten\OneDrive\Documents\Visual Studio 2012\Projects\Final Project\Final Project\bin\Release

I studied the section which is not very large and I am able to load add images, but I can't seem to figure this out.
Mar 10 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.