Prev: split form
Next: how can I send mail?
From: Highlight between 3 fields on 28 Mar 2010 19:04 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
From: Tom van Stiphout on 29 Mar 2010 00:13 On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields <Highlightbetween3fields(a)discussions.microsoft.com> 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
From: John W. Vinson on 29 Mar 2010 00:40 On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields <Highlightbetween3fields(a)discussions.microsoft.com> 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]
From: Jon Lewis on 29 Mar 2010 06:20 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" <tom7744.no.spam(a)cox.net> wrote in message news:66a0r591emglpl1dvq61fvo69vrgomsf3v(a)4ax.com... > On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields > <Highlightbetween3fields(a)discussions.microsoft.com> 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
From: Jon Lewis on 29 Mar 2010 07:28
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" <tom7744.no.spam(a)cox.net> wrote in message news:66a0r591emglpl1dvq61fvo69vrgomsf3v(a)4ax.com... > On Sun, 28 Mar 2010 16:04:01 -0700, Highlight between 3 fields > <Highlightbetween3fields(a)discussions.microsoft.com> 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 |