Re: Open some dialog boxes and the mouse cursor moves to one of the di
- From: "Dragon" <no@xxxxxxxxxxx>
- Date: Fri, 19 Aug 2005 14:50:05 +0400
SetCursorPos is actually Boolean, not Long.
Roman
"Scott Swigart" <scott@xxxxxxxxxxxxxxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:836F30B0-9E4C-40E0-A24F-BC6CCD432610@xxxxxxxxxxxxxxxx
> Here you go.
> Create a form with a button on it, and then paste in the following
code:
>
> Public Declare Function SetCursorPos Lib "user32" (ByVal X As
Integer,
> ByVal Y As Integer) As Long
> Public Declare Function ClientToScreen Lib "user32" (ByVal hWnd As
> IntPtr, ByRef point As POINT) As Boolean
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim p As New POINT
> p.x = Button1.Left + (Button1.Width / 2)
> p.y = Button1.Top + (Button1.Height / 2)
> ClientToScreen(Me.Handle, p)
> SetCursorPos(p.x, p.y)
> End Sub
>
> - Scott Swigart
>
> P.S. Moving the mouse for the user is generally considered a no-no.
>
> "**Developer**" wrote:
>
> > Open some dialog boxes and the mouse cursor moves to one of the
dialog
> > buttons.
> > I'd like to implement that .
> > Is that simply something I have to program, i.e. figure out where I
want the
> > cursor and move it.
> > Or does DotNet help somehow?
> >
> > Thanks
> >
> >
> >
.
- References:
- Open some dialog boxes and the mouse cursor moves to one of the dialog buttons
- From: **Developer**
- RE: Open some dialog boxes and the mouse cursor moves to one of the di
- From: Scott Swigart
- Open some dialog boxes and the mouse cursor moves to one of the dialog buttons
- Prev by Date: Re: Saving drawing graphics
- Next by Date: Forms in c#
- Previous by thread: RE: Open some dialog boxes and the mouse cursor moves to one of th
- Next by thread: Re: Open some dialog boxes and the mouse cursor moves to one of the dialog buttons
- Index(es):
Relevant Pages
|