How would I display an Icon at 48×48 resolution on a form in vb.net?
I looked at using imagelist , but I don’t know how to display the image that I add to the list using code and how to specify it’s coordinates on the form.
I did some google searching but none of the examples really show what I need to know.
How would I display an Icon at 48×48 resolution on a form in vb.net?
Share
The ImageList is not ideal when you have image formats supporting alpha transparency (at least it this used to be the case; I didn’t use them a lot recently), so you are probably better off loading the icon from a file on disk or from a resource. If you load it from disk you can use this approach:
Update: if you instead want to have the icon as an embedded resource in your assembly, you can alter the LoadIconFromFile method so that it looks like this instead: