Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Go Back  Xtreme Visual Basic Talk > > > Put the cursor on the defined position without moving the mouse


Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2014, 08:38 AM
sarmad sarmad is offline
Newcomer
 
Join Date: Oct 2014
Posts: 1
Default Put the cursor on the defined position without moving the mouse


hello
I have a question that (plz see the attachment) that if we collide the mouse pointer with the walls so the mouse pointer moves to the start position.........
anybody help
Attached Files
File Type: zip multigame.zip (27.3 KB, 5 views)

Last edited by Cerian Knight; 10-21-2014 at 10:32 PM. Reason: Removed exe from attachment (per posting guidelines)
Reply With Quote
  #2  
Old 10-23-2014, 01:02 PM
passel's Avatar
passelPut the cursor on the defined position without moving the mouse passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,026
Default

Your zip file is missing the casino subdirectory and your Form1.frm file, so can't be run.
In any case, if I understand the question, you probably want to use an API call to set the position of the mouse cursor.

Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

You can then call SetCursorPos x,y where x,y is a point on the screen in pixel coordinates.
You will probably want to convert a set of coordinates in your form to screen coordinates, which I don't want to take the time to look up how to go about it.
As a crude method you can probably determine where the point is relative to the top,left of your form and just add it to your form's position (which is in twips) and convert to pixels.

Assume the point you want is 1500 twips in X and Y relative to the corner of your form (including form borders).
Then something like this would convert the X coordinate to screen.
xm = (Me.Left + 1500) / Screen.TwipsPerPixelX
ym = (Me.Top + 1500) / Screen.TwipsPerPixelY
SetCursorPos xm,ym 'move the mouse pointer to that point.

If you look, there may be an API that can convert a control's (window) coordinate to Scrreen coordinate more directly.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
 
Put the cursor on the defined position without moving the mouse
Put the cursor on the defined position without moving the mouse
 
-->