Print Page | Close Window

Change Text Color

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=8909
Printed Date: 02 May 2024 at 1:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change Text Color
Posted By: spbrady
Subject: Change Text Color
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: spbrady
Date 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!


Posted By: Oleg
Date 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


Posted By: spbrady
Date 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


Posted By: Oleg
Date Posted: 27 November 2007 at 11:49am

try

 
Item.TextColor = (uint)(0xFF0000);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: spbrady
Date 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


Posted By: spbrady
Date Posted: 27 November 2007 at 12:01pm
Thanks again for your help!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net