If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
move mouse
Hello
I wonder if it is possible to move the mouse when the form opens? I Mean that when the form opens, so I want the mouse arrow moves direct to the edge of the screen monitor instead of moving it with my hand. Thanks |
#2
|
|||
|
|||
move mouse
On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields
wrote: Not unless you go to extremes. -Tom. Microsoft Access MVP Hello I wonder if it is possible to move the mouse when the form opens? I Mean that when the form opens, so I want the mouse arrow moves direct to the edge of the screen monitor instead of moving it with my hand. Thanks |
#3
|
|||
|
|||
move mouse
On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields
wrote: Hello I wonder if it is possible to move the mouse when the form opens? I Mean that when the form opens, so I want the mouse arrow moves direct to the edge of the screen monitor instead of moving it with my hand. Thanks About all I can think of is to have a small textbox where you want the cursor to appear (unbound of course), and set focus to it in the form's Load event. -- John W. Vinson [MVP] |
#4
|
|||
|
|||
move mouse
You can do this using Windows api functions. If you're not familiar with
the Windows API then Google for explanation and for what the functions I've used do. The code below will maintain the current Y co-ordinate of the cursor but place it at the right edge of the screen. Modify for the effect you want. In Declarations section of your form's Module: Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Type POINTAPI X As Long Y As Long End Type Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long In your form's Load Event: Dim pt As POINTAPI Dim rct As RECT GetWindowRect GetDesktopWindow, rct 'get screen coordinates of the Desktop GetCursorPos pt 'get current position of cursor SetCursorPos rct.Right, pt.Y 'move cursor to far right of screen & current y coordinate HTH Jon "Tom van Stiphout" wrote in message ... On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields wrote: Not unless you go to extremes. -Tom. Microsoft Access MVP Hello I wonder if it is possible to move the mouse when the form opens? I Mean that when the form opens, so I want the mouse arrow moves direct to the edge of the screen monitor instead of moving it with my hand. Thanks |
#5
|
|||
|
|||
move mouse
Just thought I'd point out my first reply is directed at the OP not Tom -
the original post is not appearing on my newsreader. Jon "Tom van Stiphout" wrote in message ... On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields wrote: Not unless you go to extremes. -Tom. Microsoft Access MVP Hello I wonder if it is possible to move the mouse when the form opens? I Mean that when the form opens, so I want the mouse arrow moves direct to the edge of the screen monitor instead of moving it with my hand. Thanks |
#6
|
|||
|
|||
move mouse
Thank you very much
Jesus Blesses |
Thread Tools | |
Display Modes | |
|
|