How can I assign a picture to a picturebox in the code?
I want to put multiple pictures in one picturebox, like you click on the button and it changes to a random one. But how do I assign the picture to the picturebox if you what I mean?
7 Replies
This is WinForms?
Yeah
Im tryna make like an exercise to practise american states
So its gonna give you a picture and you have to type the state and then ask to correct and then I want to show a new state
I've got all the pictures in the resources
So you can just assign to
.Image
?
What resource type are your images stored in? Embedded resources, Settings.Resources, etc?idk, how do I see that
@ me if someone can help me
to load from a file you set the path in ImageLocation and the use Load (iirc)
from a resource, i don't remember, but there are for sure tons of pages describing it in internet
oh well apparently you just assign the resource to the image, like
because it's already a Bitmap