Solved

SetcursorPos API

Posted on 1997-04-04
1
669 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
1 Comment
 
LVL 2

Accepted Solution

by:
weekee earned 100 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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