Controlling edit box entering
Posted on 1997-10-22
I have tried using TMaskEdit to mask input from edit boxes, but it is too restrictive. What I need to do is know where abouts the cursor is in the box, i.e. where abouts the character being entered is going to go. e.g. I want user to enter a string MONH21 where if the first letter is m then mon appears, if it is t tue appears, I also only want the letters H or B to be entered in the 4th position and the TEditMask deals with the two digits on the end.
I have another similar situation, where I want floats to be entered to 4dp with 3places to the left of the dp. So - when 3 digits have been entered and there isn't a dp there yet, one appears in the right place, also if someone presses '.' then I want the dp to move to where the user is positioned. I thought that the position of the cursor could be determined by the StartSel property of edit boxes and the SelLength would be zero if there was only a cursor flashing.
Does anyone know how to find the cursor pos?
Thanks in advance -