Background Text Color

forum.cdk (1998-2005) & forum.td.cdk (2005-2010)
Andrew Peacock

Background Text Color

Post by Andrew Peacock » 26 Jan 2006, 18:09

 Posted by:  Andrew Peacock 

Hi,
I would like to know if you can change the color of background text and
if so could someone help me.

Thanks
Andy

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2168
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Background Text Color

Post by Jeff Luther » 26 Jan 2006, 18:29

 Posted by:  Jeff Luther 

This should do it. Text app saved in v4. The 'secret' is to first:
Applicatin Actions
On SAM_AppStartup
Set bStaticsAsWindows = TRUE ! TD sys. var.

and later:
!get a handle to any text
Set hWndBkText = SalGetFirstChild( hWndForm, TYPE_BkgdText )
! then to change background color...
Call SalColorSet( hWndBkText, COLOR_IndexWindow, COLOR_Red )

I added a little code to show how to find which bk. text handle you have, in
case there's > 1 on your form. In that case, you'd need to loop through the
form's text children using SalGetNextChild( hWndBkText, TYPE_BkgdText )
until you found the one you wanted to change.

Best Regards,
Jeff Luther/PC Design
info: www.pulpcards.com/gupta/

Attachment: BkGrndText-changeColor.zip

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2168
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Background Text Color

Post by Jeff Luther » 26 Jan 2006, 18:33

 Posted by:  Jeff Luther 

Hmmm, you may have wanted to change the text color, not background color,
so if that's the case change COLOR_IndexWindow --> COLOR_IndexWindowText
in the call to SalColorSet() below.

- Jeff

Andrew Peacock

Background Text Color

Post by Andrew Peacock » 27 Jan 2006, 14:56

 Posted by:  Andrew Peacock 

Hi Group,
I have tried it and when i do the Set hWndBkText = SalGetFirstChild(
hWndForm, TYPE_BkgdText ) it is not bringing back a handle for the
TYPE_BkgdText.

Thanks
Andrew Peacock

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2168
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Background Text Color

Post by Jeff Luther » 27 Jan 2006, 16:54

 Posted by:  Jeff Luther 

Hmmm, pretty basic, bStaticsAsWindows has been around for a long time... What
version of TD are you using?

"I have tried it" - the sample I sent? If you wrote your own, *make sure* the
Set bStaticsAsWindows = TRUE
is set at startup, NOT on the create of the form. Create's too late, as I
found out when writing the sample.

"it is not bringing back a handle" - what does the function return? Another
hex value, or 0? (Use break, set it on the Call statement and evaluate
hWndBkText to find out.)

- Jeff

Andrew Peacock

Background Text Color

Post by Andrew Peacock » 01 Feb 2006, 11:28

 Posted by:  Andrew Peacock 

Hi Jeff,
I was trying to do it in Team Developer 2 but it didnt work. I tried it
in Team Developer 2005.1 and it worked fine so Team Developer 2 can't handle
it.

Thanks for all your help
Andrew Peacock

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2168
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Background Text Color

Post by Jeff Luther » 01 Feb 2006, 17:01

 Posted by:  Jeff Luther 

"Team Developer 2" - you mean CTD v2? If so, then I've attached a v1.5 version of
the little test case (you can read that in with your CTD v2 and try it.) Both my
CTD v1.5 and CTD v2.1 (I don't have v2) work with this sample to show changing
background to red, so I'm not sure what didn't work (except you didn't set the ver.
back to v2.)

If you don't mean CTD v2, then I've never heard of your designation, so I can't
help you further. Perhaps someone else here can(?) In that case, more info. on
what Team Developer 2 is might help.

- Jeff

Attachment: BkGrndText-changeColor-CTDv15.zip

Return to “td.cdk”

Who is online

Users browsing this forum: [Ccbot] and 0 guests