|
-
Jun 4th, 2009, 10:42 AM
#1
Thread Starter
Lively Member
[RESOLVED] If ... Show image/picture
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
-
Jun 4th, 2009, 10:46 AM
#2
Re: If ... Show image/picture
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.
-
Jun 4th, 2009, 10:53 AM
#3
Thread Starter
Lively Member
Re: If ... Show image/picture
I would like to use a Picture box.
-
Jun 4th, 2009, 10:55 AM
#4
Re: If ... Show image/picture
Code:
PictureBox1.Load(myFilename)
will work where myFilename is the filename (including path) of the image, and PictureBox1 is the name of your picturebox.
-
Jun 4th, 2009, 11:01 AM
#5
Thread Starter
Lively Member
Re: If ... Show image/picture
 Originally Posted by keystone_paul
Code:
PictureBox1.Load(myFilename)
will work where myFilename is the filename (including path) of the image, and PictureBox1 is the name of your picturebox.
ok. thanks
-
Jun 4th, 2009, 05:41 PM
#6
Thread Starter
Lively Member
Re: If ... Show image/picture
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
-
Jun 4th, 2009, 06:55 PM
#7
Junior Member
Re: If ... Show image/picture
The PictureBox's MouseDown, MouseUp, MouseClick, or MouseDoubleClick events can do that, depending on what you want.
See this page
-
Jun 5th, 2009, 11:13 AM
#8
Thread Starter
Lively Member
Re: If ... Show image/picture
 Originally Posted by crimsondynamo329
The PictureBox's MouseDown, MouseUp, MouseClick, or MouseDoubleClick events can do that, depending on what you want.
See this page
MouseClick event would be what I would like to use if someone could give me some advice on using it I would be very appreciated.
-
Jun 5th, 2009, 12:00 PM
#9
Addicted Member
Re: If ... Show image/picture
Code:
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
' Do something
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|