I want to show a certain picture if it meets the critiera required. I would be using either an IF function or a CASE function but I don't know the code to show the image. The image will come from a file. Thanks
Printable View
I want to show a certain picture if it meets the critiera required. I would be using either an IF function or a CASE function but I don't know the code to show the image. The image will come from a file. Thanks
What do you want to show the image in? You can use a picture box on your form, or paint the image onto a form, or show a new form with nothing but the image on it, or I'm sure there are other ways as well.
Depending on which one you want to do, the method of achieving it will be different.
I would like to use a Picture box.
will work where myFilename is the filename (including path) of the image, and PictureBox1 is the name of your picturebox.Code:PictureBox1.Load(myFilename)
Another question, Can I make an image be a button. When it is pressed it runs a line of code or is something else required? Thanks
The PictureBox's MouseDown, MouseUp, MouseClick, or MouseDoubleClick events can do that, depending on what you want.
See this page
Code:Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
' Do something
End Sub