Results 1 to 5 of 5

Thread: position cursor

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    457

    position cursor

    Hello
    I've been trying to locate cursor at a given position on my form. googling has not helped so far.
    if you could point me in the right direction or provide a code example I would be grateful.
    george

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    457

    Re: position cursor

    i've tried
    Code:
     Cursor.Position = New Point(Cursor.Position.X + 50, Cursor.Position.Y + 50)
    but it locks the computer up because there is no mouse cursor

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,648

    Re: position cursor

    FYI, to say that you're trying to locate something is to say that you're trying to determine where it is. If you are trying set the location then you are trying to position it. It's a subtle difference and probably not obvious to non-native speakers - not sure if that's you - but it is a difference.

    As for the issue, are you actually trying to move the cursor a specific distance relative to where it currently is or move it to a specific location? They are two different things and post #1 implies the latter while post #2 implies the former.

    Regardless, I'm not sure why getting Cursor.Position would cause your computer to lock up. Even if there is no actual cursor displayed on the screen, there's a still a value stored in the system for its location, so there's no reason for that to be a problem. If it is then that's a system issue, not a code issue.

    EDIT:

    I just noticed that you did say "position cursor" in the title but "locate cursor" in the post, so you were half right.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    24,272

    Re: position cursor

    Quote Originally Posted by georgesutfin View Post
    i've tried
    Code:
     Cursor.Position = New Point(Cursor.Position.X + 50, Cursor.Position.Y + 50)
    but it locks the computer up because there is no mouse cursor
    If it locks up your computer, it could be some kind of recursion happening. Where are you using that code?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    457

    Re: position cursor

    you were right there was recursion(unwanted)
    thanks
    george

Posting Permissions

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



Click Here to Expand Forum to Full Width