Highlighting Keywords within a Gui, Add, Edit Box

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HeXaDeCiMaToR
Posts: 155
Joined: 08 Feb 2021, 12:42

Highlighting Keywords within a Gui, Add, Edit Box

10 Apr 2021, 17:15

First, is there a way to highlight Keywords within an EditBox?

I'm thinking that I can run an IfInStrng, var, "WORD". If "True", find the position and length of the word and then insert the command (much like AHK Forums does) of either changing the text color or, if available, highlighting the word a specific color. But... I'm not sure it's possible.
User avatar
boiler
Posts: 16918
Joined: 21 Dec 2014, 02:44

Re: Highlighting Keywords within a Gui, Add, Edit Box

10 Apr 2021, 17:31

One approach is to use the RichEdit control by @just me (translated by @burque505).
HeXaDeCiMaToR
Posts: 155
Joined: 08 Feb 2021, 12:42

Re: Highlighting Keywords within a Gui, Add, Edit Box

16 Apr 2021, 09:57

Thanks for the response Boiler!

I've totally given up on the RichText idea (the examples were showing that I wouldn't be able to click/drag to highlight/edit the text that was in that box) and decided to just have an input field above the designated edit box with the text to evaluate that will have IfInString for all the keywords and plug them into that line. I might try to find the position of the work (to read its context in the larger text) and auto drag highlight, but probably nothing too fancy.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, CrowexBR, Google [Bot], Joey5, Nerafius, Rohwedder and 122 guests