Selecting text in single-line entry fields - small UI issue

J. Landman Gay jacque at
Fri Jan 29 11:16:40 EST 2016

The focusborder property will outline the currently active field with a color. If you use that, you won't have to set the field's backcolor. 

If you do want to script the behavior, you can use either the openfield or focusIn message as the trigger. When focus is lost, a focusOut message is sent as well as either closefield or exitfield, which you can use to reset the field appearance. 

I've had to work around the disappearing selection text on Windows before (it doesn't happen on Mac) and found that for black text, the best background color is a pale shade. I think I used a very light yellow. 

On January 29, 2016 3:21:29 AM CST, Roland Huettmann <roland.huettmann at> wrote:
>Paul, yes, autohilite does it. ) But nevertheless, to perform some
>I need a trigger while tabbing.
>I am using LC 7.1, Windows 8.1
>The actual question was another one:
>The text is highlighted - yes - in both cases.
>But the single-line field rectangle is not, just the text itself.
>I would like to have the visual effect showing a fully highlighted
>(not the text itself) where the text is visible and selected - and
>the color showing is set apart more than just 1 pixel from the border
>the field boundaries.
>This simply looks better than a chunk of text being selected.
>This can somehow be done tabbing into the field and then setting the
>backgroundcolor of field.
>But setting the backgroundcolor to the hilitecolor will make the text
>// The text chunk only appears when tabbing out or deselecting it.
>the hilitecolor to empty does not make a difference. //
>on tabkey
>   set the hilitecolor of field "Test1" to blue
>   set the backgroundcolor of field "Test1" to the hilitecolor of field
>   select the text of field "Test1" // The text DISAPPEARS
>end tabkey
>One way of achieving the desired effect is with a trick:
>Set the actual field to be transparent. Put a graphic or another
>(field..) behind. Selecting the text of the transparent field will
>the color of the control behind it and the visual effect will be as
>if the hilitecolor is set to the same color as the backgroundcolor in
>control behind.
>But of course - this is not something I would like to do for all my
>On 28 January 2016 at 22:26, Paul Hibbert <paul at> wrote:
>> On Jan 28, 2016, at 4:07 AM, Roland Huettmann
><roland.huettmann at>
>> wrote:
>> >
>> > Maybe I am missing something, but I need to script this with "on
>> > tabkey"-event handlers, "on textchanged" handlers, " on deletekey"
>> handlers
>> > and go with "select the text of..." or "select line 1 of...".
>> the
>> > cursor is always placed behind the text - and I do not want that
>> for
>> > multi-line fields. Could there not be a built-in attribute how
>> > should occur?
>> Check the autoTab property in the inspector, or if you want to set it
>> script…
>> set the autoTab of field “myField" to true
>> I’m not seeing any issue with text changing colour when selected, but
>> didn’t say which version of Livecode or which platform you are seeing
>> on, this info may help track down the problem.
>> Paul
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>use-livecode mailing list
>use-livecode at
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the use-livecode mailing list