>>Hi All,
>>
>> I want to know the current positions of my cursor in screen. (not in form or text box). How can i get it. On that basis i wanted to show my next form i.e. it should not come over my current cursor.
>>
>>Regards
>>Amit
>Amit,
>Assuming your form's scalemode set to pixels this could help you as a starter :
with _Screen.Activeform.ActiveControl
> lnWidth = txtwidth(substr(.Text,1,.selstart+1), .FontName, .FontSize)*Fontmetric(6,.FontName, .FontSize)
> lnPosX = objtoclient(_Screen.Activeform.ActiveControl,2) + lnWidth
> lnPosY = objtoclient(_Screen.Activeform.ActiveControl,1) + .height
>endwith
Cetin
Cetin,
Unfortunately, I've discovered that no all controls that might be of interest have a SelStart; the API call GetCaretPos() is the only way that I've found to retrieve it, and the return is in client coordinates, so there's more translation involved.