OK, your error message as shown doesn't match your code:
'Images' is not a member of 'Add.(Image.FromFile)
ImageList1.Images.Add(Image.FromFile(singleFile))
The code sample does not contain a '.' character after the call to Add - so either you hand typed the error or you hand typed the code into your question.
And If I copy your code and paste it into a VB WinForms app by adding four items - the button, ListView, OpenFileDialog, and ImageList - it compiles fine. And it runs without error if I press the button - the image is added to the list.
So it's not the code that is the problem if it is exactly as you show - it's either something do with the project type, the code isn't as you show, or most likely the error message doesn't relate to that code but to different code in the same app.
So start here
How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[
^] and look at the actual message very carefully - it contains a lot of info that you haven't given us!
Quote:
The text of the error does not seem to apply to this problem. I don't see any typing errors. I don't know what else to tell you. I don't know how you could run it, but I cannot.
Simple: now you give us the actual error message it's obvious.
Quote:
BC30456 'FromFile' is not a member of 'MediaTypeNames.Image'
A simple google for "MediaTypeNames" will show you it's part of the System.Net.Mime namespace, which has to do with eMail, not displays.
Since an ImageList requires a System.Drawing.Image and the two classes are not equivelant or related you get the error.
So it's likely that you have a
using
statement that references MediaTypeNames when what you need for this code is System.Windows.Forms, or a fully qualified name for the Image class.
See how much info you can get from an error message?