Cursor Position

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vdraceil
    New Member
    • Jul 2007
    • 236

    Cursor Position

    How do i know the cursor postion in a form?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by vdraceil
    How do i know the cursor postion in a form?
    If you mean the mouse pointer, then I suppose the MouseMove event will tell you that. Or you might be able to use an API call to get it at any time.

    People tend to use the word "cursor" for a lot of different things.

    Comment

    • Robbie
      New Member
      • Mar 2007
      • 180

      #3
      ...and if you meant the position of the text cursor in a text box, you can use the property TextBox.SelStar t

      Also, you might find useful TextBox.SelLeng th - how many characters are selected (highlit) in the text box.

      Comment

      • Ste The Fluffy
        New Member
        • Sep 2006
        • 10

        #4
        In a mouse event such as Mousedown, up or move, X returns the arrow's distance from the left, and Y it's distance from the top.
        HTH.

        Comment

        • SammyB
          Recognized Expert Contributor
          • Mar 2007
          • 807

          #5
          Originally posted by vdraceil
          How do i know the cursor postion in a form?
          What VB? VB6, VBA, or VB.NET.
          In VB.NET, Control.MousePo sition gives you the screen position and you can subtract the form's Left & Top property. And, as others have said, in the form click event, you can cast EventArgs into MouseEventArgs and use the X & Y properties. HTH --Sam

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            I don't think there's much point speculating any further until we hear back from vdraceil.

            Comment

            Working...