Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: TColor into Memo



Permlink Replies: 1 - Last Post: Jul 28, 2016 9:24 AM Last Post By: Remy Lebeau (Te...
Ilenia Scarcelli

Posts: 2
Registered: 8/28/16
TColor into Memo
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2016 6:56 AM
Hello everyone! I have this problem:
I enter into a Memo colors of an object that set during data entry.
Click on a T Shape,appears Color dialog where I choose the color..
TColor color;
Shape1MouseDown...
{
if(!ColorDialog1->Execute()) return ;
color = ColorDialog1->Color;
}

In the dataInsert()
....
color=Shape1->Brush->Color;
picture[count].setColor(color);


In the dataSet():
for(int i=0; i<count;i++)
{
int rgb=ColorToRGB(picture[i].getColor());
int r=GetRValue(rgb);
int g=GetRValue(rgb);
int b=GetRValue(rgb);
Memo->Lines->Add(r);
Memo->Lines->Add(g);
Memo->Lines->Add(b);
}


it doesn't work.. The color is always the default.

Edited by: Ilenia Scarcelli on Jul 28, 2016 7:08 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: TColor into Memo [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2016 9:24 AM   in response to: Ilenia Scarcelli in response to: Ilenia Scarcelli
Ilenia wrote:

if(!ColorDialog1->Execute()) return ;
color = ColorDialog1->Color;

And where exactly do you use the color value that the user has picked?

color=Shape1->Brush->Color;

Are you ever assigning the user's chosen color value to the TShape's Brush?

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02