TextBox cursor position

Started by hmspe, April 27, 2012, 09:49:26 PM

Previous topic - Next topic

hmspe

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.

Fred Tomke

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

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

hmspe

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.