VSSpell Control > VSSpell All Members > VSSpell Properties > CaretPosX Property |
Returns the horizontal position of the caret on the edit window linked to the VSSpell control.
[form!]VSSpell.CaretPosX[ = value As Long ]
The caret position is returned in screen coordinates and expressed in twips.
This property is useful if you want to position user-interface elements such as pop-up menus or forms next to an offending word while spell checking. For example, to display a pop-up menu with a list of words, you would write code such as:
Example Title |
Copy Code
|
---|---|
PopupMenu mPopup, , VSSpell1.CaretPosX - Left, VSSpell1.CaretPosY - Top |
Note that the code subtracts the form's Left and Top properties from the values of CaretPosX and CaretPosY. This converts the coordinates from screen to form units, as required by Visual Basic's PopupMenu command.
Long