Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making pretty forms

Status
Not open for further replies.

jjschwartz

Technical User
Feb 3, 2004
23
US
I'm trying to design a pretty form (yes, the best way to learn a language is to program a game). I'd like the labels/fields near the top to be on a blue background, near the middle to be on a red background, and near the bottom to be on a green background.

I'm thinking of putting all the components in a panel and adding big rectangular TImages of block color for the backgrounds. But this sounds inelegant and I have to make sure the fields are in front of the colored TImages. Is there a more straightforward way to do this?

TIA,
Jeff Schwartz
 
Not sure what you are asking.

Panels and some other component have background colors properties (as labeles itself). And you can use shapes too.

May be Im not getting your point.

buho (A).
 
I guess my language skills let me down. Let's see if my artistic skills are any better. I'd like my form to look something like this...

----------------------
<red><red><red>
<red> LABEL <red>
<red><red><red>
<green><green><green>
<green> EDITFIELD <green>
<green><green><green>
<blue><blue><blue>
LABEL <blue> EDITFIELD <blue>
<blue><blue><blue>
----------------------

Maybe what I need is just three separate panels each with a different background color?
 
Yes, use 3 panels (TPanel components) with different background colours. Before adding the label to the form (by double-clicking the TLabel component from the Standard page of the toolbar), make sure the first panel is selected and then it should add the label to that panel.

Similarly, select the 2nd panel then add an edit box (a TEdit from the standard page of the toolbar). Repeat the same process for the 3rd panel.

Set the Color property of each panel to the colour you desire.

Panels are definitely preferrable to images of block colour because they can contain other components within them.

Hope this helps!

Clive [infinity]
 
You can also use a gradient fill within the panels using LMDtools SE (the package that ships free with D5/D6/D7) to do something similar. The component is [tt]TLMDFormFill[/tt].

You can change the orientation of the fill, and use bitmaps like Web page backgrounds to tile the form or component background.

So if you have a 800 x 2 pixel (24 bit) tile (or whatever screen width you aiming at), with a gradient across it with your colours, it will give the appearance of full size bitmap, but only take up about 5k.

Just another approach....

Cheers

Chris ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top