Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Highlighting Text in an Edit Box in an Event Handler (Functions/Subroutines/Programs) ====== ====== ====== ==== Created at 28 MAY 1997 02:25PM ==== If you have an edit box with some default text in it, and you would like it to be highlighted on an event such as GOTFOCUS, the following code shows how to do this. Highlighting the default text allows the user to enter data into an edit box without having to delete the default text. (on the GOTFOCUS event for EDITLINE_1 in form FORM_1) Declare Subroutine Set_Property SelectLength = 1:@fm:65534 /* * The value 1 indicates where the selected text should start. The value * 65534 indicates all text be selected. This value can also be any * number in the middle of the text indicating the ending position of * the selected text. * Alternatively, if you need to highlight text from right to left, the //startpos// field * of SelectLength (first value) would contain the numerical position where * selected text starts, and the //length// field would contain a negative number * indicating the ending position of the selected text. */ Set_Property('FORM_1.EDITLINE_1', 'SELECTION', SelectLength) RETURN 0 kb/kb_articles/kb0099.txt Last modified: 2024/01/30 13:36by 127.0.0.1