Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - Change Text Color
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change Text Color

 Post Reply Post Reply
Author
Message
spbrady View Drop Down
Newbie
Newbie


Joined: 26 November 2007
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote spbrady Quote  Post ReplyReply Direct Link To This Post Topic: Change Text Color
    Posted: 26 November 2007 at 6:08pm
Hello,

I can't seem to change the text color of one of my items in TaskPanel.

I am using VS.NET 2005

Item = Group.Items.Add(0, "TEXT 1", XTPTaskPanelItemType.xtpTaskItemTypeLink, -1);

Color C = Color.Red;
Item.TextColor = (uint)(C.ToArgb());

What am I missing?

Any help would be greatly appreciated, I feel like I am doing something stupid.

Thanks
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 1:04am

Hi,

 
Think its bit-order-problem. try
 
Color C = Color.Green;
Item.TextColor = (uint)(C.ToArgb());
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
spbrady View Drop Down
Newbie
Newbie


Joined: 26 November 2007
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote spbrady Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 9:36am
So how would I add and item and then change the text color.  I don't see a difference between yours and mine except for the color.

Thanks for your quick reply!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 10:05am

I mean don't use ToArgb use some hex value:

Item.TextColor = (uint)(0xff00ff);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
spbrady View Drop Down
Newbie
Newbie


Joined: 26 November 2007
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote spbrady Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 11:04am

Thanks Oleg,

I am able to change colors, but if I use the hex value for blue, the color that shows up is not blue.  Why is this

Blue = 0x0000FF
So I use Item.TextColor = (uint)(0x0000FF);

What am I doing wrong.

I am using this page to pick my colors:
http://cloford.com/resources/colours/500col.htm

Thanks
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 11:49am

try

 
Item.TextColor = (uint)(0xFF0000);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
spbrady View Drop Down
Newbie
Newbie


Joined: 26 November 2007
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote spbrady Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 12:01pm
Oleg I figured it out.

I wanted Blue which was 0x0000FF

I thought that it was in the FORMAT R,G,B.

It is actually B,G,R.

So when I put 0xFF0000 I get blue!

Do I normally need to put colors in this way?

Thanks
Back to Top
spbrady View Drop Down
Newbie
Newbie


Joined: 26 November 2007
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote spbrady Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2007 at 12:01pm
Thanks again for your help!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.