I do not see how that could work. In Windows, buttons can have the focus, which means a field would always lose it.
What I do when I need something like this is I save the selection (or selectedChunk or some such thing) as a property of the field upon exitField. You could even put that in a frontScript and reference the target. Then in the field script re-select the text upon enterField. Bob S > On Jul 12, 2023, at 3:21 PM, Paul Dupuis via use-livecode > <use-livecode@lists.runrev.com> wrote: > > I have a LC9 field object - just a scrolling field (not a list field) with a > lot of text. The user selects some text and then click a button near the > field. I want the selection to remain highlighted, but when you click outside > the field the highlight goes away. > > Any simple solutions to this. Some property I am just blanking on? In another > app, I've used the "selectionChanged" message to (1) set the background color > of the selection to a highlight color and store the start and end characters > as custom properties of the field. I'm hoping there is an easier way I am > just missing. > > OR > > There should be a feature enhancement: set the preserveHighlight of field X > to true > That keeps the highlighted selection unless or until you make a new one in > that field _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode