TextBox cursor position

Started by hmspe · 2012-04-28 04:49 UTC · 2 replies · SMF topic #1795

Is there a way to get the current cursor position in real time when editing a text box?  If not could I suggest/request adding the ability to do so?  I'd like to be able to show text being entered in a textbox on-screen in real time with a simulated cursor.  I'm trying a work-around approach of trapping flags for the arrow keys with OnKeyDown and keeping a counter for position, but that's a rather inelegant kludge. 

Thanks.
Hi, there is a GetSel method for the textbox. If no characters are selected, startposition is equal to endposition.

Regards, Fred
Thanks.  Based on the description of GetSel I thought it only returned the start and end if text was actually highlighted so I had not tried that function.  It looks like it will work for what I want to do.