Changing the Default Background Colour of Forms

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:46 pm

by Jade Dude >> Mon, 20 Oct 2003 1:16:49 GMT

Is there a way to change the "3D Face" colour so that it will apply to all forms which have the background set to 3d face?

Windows XP and Windows 2000 display different colours for the "3d Face" option and in our application we are using images with a fixed background colour which matches the winxp 3d face but doesn't match the background in windows 2000.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:46 pm

by Patwos >> Mon, 20 Oct 2003 7:42:09 GMT

The whole point of 3D Face is that this colour is whatever the user has specified in their Windows preferences and/or whatever is set for the Windows desktop theme they have chosen. You cannot guarantee what colour this is, as the user may well have set it to something completely different to what you expect.

Just ignore their settings and go with your own colour instead of 3D Face if you need to have the form backColor matching with your artwork.

Hope that helps,
Pat.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:46 pm

by Allistar Melville >> Mon, 20 Oct 2003 21:26:40 GMT

Note that you can in a script change the backColor property of forms, but there are some caveats. Firstly you still have to open and save the form in the painter after running the script. Also this is probably not officially endorsed or supported but we have used this ability to change all labels in our product to transparent (imagine doing that by hand when there are over 17,000 of them).

Alternatively change the backColor on each form explicitely on the load event. If all of your forms are subclassed from a common form this is even easier.

It would seem to make more sense to me if you used transparency in your images. Using the .png format you have access to the alpha channel so you can make portions of the image transparent. This would allow your images to look ok no matter what the operating system does with the form colours. I am unsure whether JADE fully supports transparency of pngs, or whether it is a hacked version like that in Internet Explorer which only (unfortunately) supports full or no transparency, and not the various levels of translucency that you can do in more advanced browsers.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:46 pm

by BeeJay >> Tue, 21 Oct 2003 3:19:46 GMT

Allistar,

Did your labels really need to be transparent?

I've seen lots of people who use transparent labels when they are sitting over top of a Form/GroupBox/etc where the area underneath the label is a plain <PickYourColour>. In this situation I prefer not to use transparency to remove the amount of work required to paint/repaint that label and instead set the backColor of the label to an appropriate value - generally Color_3DFace in most cases. :)

If your label is sitting over a picture, then obviously it is appropriate to use transparency.

Cheers,
BeeJay.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:47 pm

by allistar >> Tue, 21 Oct 2003 5:01:07 GMT

Hi BeeJay,
The problem was that the backColor of the labels was set to the default Windows98 grey (192, 192, 192). I think this was a bug in a very early version of JADE. If a user was using a Windows colour schema that had anything other that that colour, most forms looked quite ugly. The fix was to make all labels (and group boxes etc) transparent. We could have set the backColor to 3DFace I suppose which would have achieved the same thing.

Regards,
Allistar.
--
------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:47 pm

by BeeJay >> Wed, 22 Oct 2003 6:18:04 GMT

I wondered if that might be the case. I'd definitely have gone for the 3DFace option rather than transparency.

Actually, it's this very reason that I run with a horrible non-standard desktop colour scheme. Not because I particularly like it, but so that things such as this show up more obviously.

Cheers,
BeeJay.

PS: Wasn't it me that pointed this out to you one time.... {;-þ)

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Changing the Default Background Colour of Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:47 pm

by Allistar Melville >> Thu, 23 Oct 2003 19:33:56 GMT

I wouldn't think the overhead of transparency would be much compared to a static colour, and it would all be worn by the client machine anyway.

Thanks for the input,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 10 guests