Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SetcursorPos API

Posted on 1997-04-04
1
Medium Priority
?
695 Views
Last Modified: 2008-03-06
The SetCursorPos API sets the current cursor to a specific point on the screen as specified in its arguments: the X and Y logical coordinates. Does anyone know of an win32API that would set my cursor to the first position or any position within a textbox control that I desire it to be set to, In other words, is there an API that would take the POSITION within a textbox as an argument rather than logical co-ordinates?
SC.
0
Comment
Question by:schhaya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
weekee earned 200 total points
ID: 1425068

I don't think that there is a API to do that but you can still do it with the setCursorPos API. Simply make use of the textbox top and left property. And taking consideration of the width and height of the textbox, you can do the neccessary calculation of the x y with respect to the textbox and use this calculated value and pass it to the API,

For example :

    setCursorPos(form.hdc, textbox.left,textbox.top)

i wonder if i pass the parameter correctly but that is the basic idea for displaying the cursor at the 0,0 pos of the textbox.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question