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. C# how to get mouseover pos on a picture

C# how to get mouseover pos on a picture

Scheduled Pinned Locked Moved C#
questioncsharptutorial
7 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.
  • M Offline
    M Offline
    mercenary01
    wrote on last edited by
    #1

    How do I do a mouse over on a GIF picture? I want to get X and Y position on the gif I display over the form. Currently I can only see the mouseover pos on the form surface only not on the picture how do I do the opposite? Thanks Samuel

    M R 2 Replies Last reply
    0
    • M mercenary01

      How do I do a mouse over on a GIF picture? I want to get X and Y position on the gif I display over the form. Currently I can only see the mouseover pos on the form surface only not on the picture how do I do the opposite? Thanks Samuel

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello, Is this picture in a pictureBox? If yes, you would have to handle MouseMove there! All the best, Martin

      M 1 Reply Last reply
      0
      • M mercenary01

        How do I do a mouse over on a GIF picture? I want to get X and Y position on the gif I display over the form. Currently I can only see the mouseover pos on the form surface only not on the picture how do I do the opposite? Thanks Samuel

        R Offline
        R Offline
        rah_sin
        wrote on last edited by
        #3

        i think u should display gif image in some container like picture box and then u can get the coordinates of picture displayed.

        rahul

        1 Reply Last reply
        0
        • M Martin 0

          Hello, Is this picture in a pictureBox? If yes, you would have to handle MouseMove there! All the best, Martin

          M Offline
          M Offline
          mercenary01
          wrote on last edited by
          #4

          I am sorry, I dont know how to handle mousemove there? and yes its in a picture box. Do you have an example of how I can do this?? Thanks Samuel

          M 1 Reply Last reply
          0
          • M mercenary01

            I am sorry, I dont know how to handle mousemove there? and yes its in a picture box. Do you have an example of how I can do this?? Thanks Samuel

            M Offline
            M Offline
            Martin 0
            wrote on last edited by
            #5

            Hello,

            this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
            private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
            {
            string actmouseposition= "X: " + e.X + "; Y: " + e.Y;
            }

            Hope it helps! All the best, Martin

            M 1 Reply Last reply
            0
            • M Martin 0

              Hello,

              this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
              private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
              {
              string actmouseposition= "X: " + e.X + "; Y: " + e.Y;
              }

              Hope it helps! All the best, Martin

              M Offline
              M Offline
              mercenary01
              wrote on last edited by
              #6

              Yes! it works like a charm! Thanks lots! Thanks :) Samuel

              M 1 Reply Last reply
              0
              • M mercenary01

                Yes! it works like a charm! Thanks lots! Thanks :) Samuel

                M Offline
                M Offline
                Martin 0
                wrote on last edited by
                #7

                You are wellcome!

                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