Results 1 to 9 of 9

Thread: [RESOLVED] If ... Show image/picture

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    102

    Resolved [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

  2. #2
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    102

    Re: If ... Show image/picture

    I would like to use a Picture box.

  4. #4
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    102

    Re: If ... Show image/picture

    Quote Originally Posted by keystone_paul View Post
    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

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    102

    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

  7. #7
    Junior Member
    Join Date
    May 2009
    Posts
    17

    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

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    102

    Re: If ... Show image/picture

    Quote Originally Posted by crimsondynamo329 View Post
    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.

  9. #9
    Addicted Member
    Join Date
    Nov 2004
    Posts
    172

    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
  •  



Click Here to Expand Forum to Full Width