Solved

SetcursorPos API

Posted on 1997-04-04
1
687 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Notepad++ how to remove delimiter : from beggning of the line? 3 133
Child Form in front 4 65
VB6 ListBox Question 4 62
Sub or Function is not defined 6 59
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

739 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