views:

2366

answers:

4

How can I add a background image to my delphi form? I added a TImage, but now the labels aren't visible any more, and the texts of my checkboxes are in a blue "box" (blue is the background color i chose). This blue doesn't look very good on the background image, and the hidden labels also don't look good. How do I fix these problems?

+8  A: 

For the labels: make sure that they are transparent (Transparent property in the Object Inspector), and that they are on top of the TImage in the Z-order of controls. To correct this you can execute the "Send to back" command on the TImage component in design mode, it will make all other non-windowed controls appear on top of it.

For the checkboxes I don't know what the problem in your case is, in Delphi 2007 checkboxes appear properly transparent when put over a TImage. Maybe you use an earlier Delphi version? If so it would be good to mention this in the question. There may also be a different behaviour depending on whether themes are active. Again, hard to say without further information.

mghie
You're quick. <g> I was composing an answer, and luckily refreshed the page before posting it.
Ken White
+2  A: 

Move the TImage to the back of the form (right click, order -> send to back).

idevelop
A: 

For labels, set the Transparent property to true. For checkboxes and radio buttons, at least in Delphi 6 which is all I have access to, there is no transparent property. The way round this is to reduce the controls label to zero size and the provide your own additional TLabel, which can be transparent.

Can I also say that I find windows with background images ultra naff, and I know I'm not alone in this.

anon
A: 

how can a change the background in delphi and change it with my picture jpeg?

Nazy
Nazy, In order for you to get an answer you need to post your question as a "question" and not as an "answer".To post a question you need to click on the Post a question button on the top right of the page.
Alan Fletcher