OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: hmspe on April 27, 2012, 09:49:26 PM

Title: TextBox cursor position
Post by: hmspe on April 27, 2012, 09:49:26 PM
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.
Title: Re: TextBox cursor position
Post by: Fred Tomke on April 29, 2012, 01:55:14 PM
Hi, there is a GetSel method for the textbox. If no characters are selected, startposition is equal to endposition.

Regards, Fred
Title: Re: TextBox cursor position
Post by: hmspe on April 29, 2012, 06:19:26 PM
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.