1

How to read sections and keys in different colors in gui edit

I'm reading an .ini file, but I can't display the section and keys in different colors. reads in only 1 color

a.ini : ↓↓↓↓↓↓↓↓↓↓↓

[title]
number=test

code : ↓↓↓↓↓↓↓↓↓↓

FileRead, file, a.ini
Gui, Font, s14 cBlue
Gui Add, Edit, w435 h400 vfile, %file%
Gui, show

1 Answer 1

1

The control type GUI Edit is an area where free-form text can be entered. It does not do highlighting to display elements in colors.

You need to parse the text yourself and create the highlights yourself.

To help with the task, you may convert the text into HTML, perhaps using Regular Expressions, and display it using the library HTMLText.

An example given in the documentation for how the colored text is to be created is:

<fGeorgia><w100>Light text in Georgia</w></f><w1000>Heaviest text</w>Normal Text<u><i><b>This is underlined, italic and bold </b></i></u><cff0000><d>This is red and Deleted</d></c>
2
  • Is it impossible to display line 1 and line 2 in different font color using a loop with "FileReadLine" ?
    – emreya
    Commented Dec 23, 2021 at 22:41
  • The most you can do is select one line to distinguish it from the other.
    – harrymc
    Commented Dec 24, 2021 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .