April 29, 2024, 04:28:41 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Restoring focus to last cursor position in an edit box

Started by AdrianFox, December 20, 2008, 11:31:58 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

AdrianFox

December 20, 2008, 11:31:58 AM Last Edit: December 21, 2008, 06:00:40 AM by AdrianFox
I'm using a text edit box with a series of buttons which allow the entry of French characters, such as ÃÆ'Ã,¡, ÃÆ'Ã,¨ and ÃÆ'Ã,©.

All works ok except every time the button is pressed and the character added to the text in the edit window, focus is lost.

Although I can restore the focus to the edit box with setfocus,d1,1  the carat/cursor  is restored to the beginning of the text.

What do I need to do to restore the carat/cursor to the last text position after the  addition of the new character?

As 'ctrl-end' will take me to the end of the text, I've tried to find a way to use this, but with no success, especially as I can't seem to code for the relevant ascii keys.




Adrian Fox