Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Picturebox

Picturebox

Scheduled Pinned Locked Moved C#
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DanSteeve
    wrote on last edited by
    #1

    Hi! I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me? Thx Dan

    J M 2 Replies Last reply
    0
    • D DanSteeve

      Hi! I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me? Thx Dan

      J Offline
      J Offline
      Justin Perez
      wrote on last edited by
      #2

      Handle the click event of the picture box

      I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

      1 Reply Last reply
      0
      • D DanSteeve

        Hi! I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me? Thx Dan

        M Offline
        M Offline
        Matthew Cuba
        wrote on last edited by
        #3

        DanSteeve wrote:

        I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me?

        You can just handle the Click event by creating an event handler that does whatever you want it to do. example: myPictureBox.Click += new PictureBox.Click(myFunctionToDoSomething); private void myFunctionToDoSomething(object sender, EventArgs e) { // your stuff } Seems like that would do the trick. I'm assuming the code you want to execute is part of your application, of course. You could fire off another process within the event handler, if you wanted. Hope that helps!

        It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups