changing color,etc. in Edit field

13 posts in this topic

JeyJ0 0

I want to highlight keywords in an Edit-field in my GUI by using a changing color or make it italic/bold.

But I want to read the words to highlight out of a file like this:

Filename: bold.txt (or bold.ini)

Text:

while

for

in

so I want that the keywords "while", "for" and "in" will be bold if they are typed in the Edit-field. The same I want to do with colors etc. Could anyone please post how to, because I dont have any idea...

Share this post

Link to post

Share on other sites

BrewManNH 971

You're setting the color with a string, not even a hex string, just a string. BTW, it uses a COLORREF color code, not an RGB color code. See the help file for _ColorSetCorref, or just reverse the RGB to a BGR and add 2 zeros in front of it. RGB = 0x0000FF, COLORREF = 0x00FF0000

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.