Discussions related to Visual Prolog
ahmednadi
Active Member
Posts: 37
Joined: 15 Sep 2009 14:06

How can I color a text?

Unread post by ahmednadi »

Dear Sirs;
Could you help me to color a string with Red color?
How can I used setforegroundcolor predicate to color a string with colors and put the strings in editControl.

Regards;
AHMED
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

You can't. setForegroundColor is defined on a textControl, not on an editControl.

It is non-standard to change the font color (a doubt that you can find an edit control in Windows uses another color).

Anyways, it is not trivial to make such a change, we have only implemented it for textControls, because somebody insisted on writing red alert messages, even though it is non-standard.
Regards Thomas Linder Puls
PDC
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

Hi,

Maybe this following post can help you : http://discuss.visual-prolog.com/viewto ... 7341#27341
ahmednadi
Active Member
Posts: 37
Joined: 15 Sep 2009 14:06

Unread post by ahmednadi »

Dear Sirs;
Thank you.
I want to color a string with specific color and then put this string in editControl as a part of the whole text.
What is the command or tool used to do this?
You fast action will be highly appreciated.
Regards;
AHMED
dominique f pannier
Active Member
Posts: 40
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier »

Hi,
If you want edit colored text, you should not use an editControl, but a form in which you add a custom control sciLexer.
With this new combination in VIP 7.4, you can color each part of text you want with the color you want, and also the font, and its attributes, etc. ad libitum.
Regards
Dominique Pannier
Post Reply