Believe it or not, the old Xbase row() and col() functions are still working great in VFP 9.
These functions return the users current Y, X location (in foxel positions relative to the currently active form) as a user types content into in an edit or textbox.
This row() and col() info can be used to determine where to position a popup context menu invoked from the keyboard vs. rightmouse click. Using the row() and col() coordinates, its easy to poup a menu at the users current cursor position. (My goal)
Here's the problem: row() and col() update their positions correctly for "standard" keystrokes. But do not update correctly under the following conditions when monitored in the KeyPress or InteractiveChange events:
1. Deleting or Pasting text into a control does not immediately update row() and col() values
2. Highlighting text does not immediately update row() and col() values
3. Using the cursor keys to move cursor results in a one char "lag" in row() and col() values being updated
4. Row()/col() monitoring in KeyPress() event has a one char lag when word wrap occurs at the end of a line. Note that row()/col() values are correctly reported at wordwrap when monitored from InteractiveChange.
So ... any suggestions on how I can determine current cursor position within a text or editbox?
Thanks!
Malcolm