1 Replies - 4795 Views - Last Post: 26 December 2012 - 04:44 PM Rate Topic: -----

#1 Crystalz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 05-October 12

Reverse X & Y axis

Posted 26 December 2012 - 04:17 PM

Hey, I'm making a program to show the coordinates wherever the mousecursor is. That part is done.
But right now the coordinates is showing from top to bottom. It starts at 0 at the left top corner, and gets higher when I move the cursor away from it. Is there anyway to reverse this so it starts from the left corner and the number goes down when I move the cursor from it?

This is my current code i'm using.

Private Sub PictureBox1_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove

        Label1.Text = "X." & e.X & vbCrLf & "Y." & e.Y

    End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Reverse X & Y axis

#2 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3643
  • View blog
  • Posts: 12,643
  • Joined: 12-December 12

Re: Reverse X & Y axis

Posted 26 December 2012 - 04:44 PM

You have to subtract from the height of the form:
(Me.Height - e.Y)

I don't believe this to be VB6?!

Also, why are you using the Click event-name but over-riding it to handle MouseMove?

This post has been edited by andrewsw: 26 December 2012 - 04:45 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1