Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Memo Color


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Dec 4, 2014 11:57 AM Last Post By: Boba ½°
george probyn

Posts: 21
Registered: 7/7/09
Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 4:33 AM
Hi, OK there seems no way to thicken the border of a memo, either at design nor run time. I can set the color at design time, but how can I change the colour at run time depending on a GUI entered field. I would like to write clRed in an edit box , for example. But I don't think that will work. The only thing I can think of is to build an array of different coloured boxes on the GUI and allow the use to choose, but that seems rather long winded.

George.
Boba ½°

Posts: 73
Registered: 12/19/03
Re: Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 7, 2014 1:35 PM   in response to: george probyn in response to: george probyn
"george probyn" wrote in message news:698874 at forums dot embarcadero dot com...
Hi, OK there seems no way to thicken the border of a memo,
either at design nor run time.

you have to do manual processing of the TMemo non-client painting.

but how can I change the colour at run time depending on a GUI
entered field.

StringToColor: "Translates a string representation of a color to
the corresponding TColor value."
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 8, 2014 10:40 AM   in response to: Boba ½° in response to: Boba ½°
Boba wrote:

how can I change the colour at run time

TMemo has a Color property.

depending on a GUI entered field.

StringToColor: "Translates a string representation of a color to the
corresponding TColor value."

StringToColor() accepts the folowing string values as input:

1. predefined color constant names that have a "cl" prefix:

Color = StringToColor("clBlack");
Color = StringToColor("clActiveBorder");


2. an RGB integer value, in decimal or hexidecimal format:

Color = StringToColor("0");
Color = StringToColor("0x000000");


--
Remy Lebeau (TeamB)
Boba ½°

Posts: 73
Registered: 12/19/03
Re: Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 12:03 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
"Remy Lebeau (TeamB)" wrote in message
news:701184 at forums dot embarcadero dot com...
Boba wrote:
how can I change the colour at run time

did I?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 1:29 PM   in response to: Boba ½° in response to: Boba ½°
Boba wrote:

did I?

Did you what?

--
Remy Lebeau (TeamB)
george probyn

Posts: 21
Registered: 7/7/09
Re: Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 13, 2014 11:58 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Boba wrote:

how can I change the colour at run time

TMemo has a Color property.

depending on a GUI entered field.

StringToColor: "Translates a string representation of a color to the
corresponding TColor value."

StringToColor() accepts the folowing string values as input:

1. predefined color constant names that have a "cl" prefix:

Color = StringToColor("clBlack");
Color = StringToColor("clActiveBorder");


2. an RGB integer value, in decimal or hexidecimal format:

Color = StringToColor("0");
Color = StringToColor("0x000000");


--
Remy Lebeau (TeamB)

Thank you both I had no idea where to find String ToColor.

George.

Boba ½°

Posts: 73
Registered: 12/19/03
Re: Memo Color  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 4, 2014 11:57 AM   in response to: george probyn in response to: george probyn
"george probyn" wrote in message news:701743 at forums dot embarcadero dot com...
... I had no idea where to find String ToColor.
I guess you did find it in Graphics.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02