Results 1 to 1 of 1

Thread: Visual Basic 08/10 Tutorial | Y & X Points

  1. #1
    Senior Member
    Join Date
    Mar 2013
    Location
    Russia
    Posts
    240
    Rep Power
    5

    Visual Basic 08/10 Tutorial | Y & X Points


    Today Gonna Show you how to make Label = X of Your Mouse.
    Let's Start
    -----------------------------------
    Code's we're going to use:
    -
    Code:
    Point = Control.MousePosition
            Me.Location = Point
    -
    Code:
    Label2.Text = Point.Y
    -
    Code:
    #Region " Nothing "
        Dim Point As New System.Drawing.Point()
        Dim X, Y As Integer
    #End Region
     ----------------
            Label1.Text = Point.X
            Point = Control.MousePosition
    -----------------------------------
    What We Need:
    2 Labels
    3 Timers
    Small Form (Prop. >> TransparencyKey = White >> BackColor = White) To Make it unvisible.
    -----------------------------------
    Let's Understand The First Code.
    -----------------------------------
    Double Click on Timer1
    -
    Code:
    Point = Control.MousePosition
            Me.Location = Point
    Point = Control.MousePosition : It's a Define to make the code works.
    Me.Location = Point : Me is a Define For Form1, so if i'm coding the form and want to make a command in it i name it "Me", and The Code mean, Form1 Location is the point of the mouse.
    -----------------------------------
    Double Click on Timer2
    -
    Code:
    Label2.Text = Point.Y
    Easy and Simple : The text in label2 = Point Y of my Mouse while moving
    -----------------------------------
    -
    Code:
    #Region " Nothing "
        Dim Point As New System.Drawing.Point()
        Dim X, Y As Integer
    #End Region
    This Need to be added over Private Sub of Timer to let the Code works **WITHOUT IT WILL NOT!**
    #Region " Nothing " You can Write anything place Nothing, it doesn't change anything.
    Sorry The Code i can't make you understand it because it's not easy to say. =)
    -----------------------------------
    Code:
    Label1.Text = Point.X
            Point = Control.MousePosition
    As We Said : Label1 text = Point X of Mouse While Moving.
    Point = Control.MousePosition = Define Makes the Code Works.
    -----------------------------------
    Done! Hope You understood Something, and sorry for my english =)
    Example for the Program will be in attachment, if you want to close the program try to click on a dot will be under the mouse and click "C" in your keybored and will close =)
    Attached Files Attached Files

    The Best VPN!
    VVV Click Below VVV


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •