| View previous topic :: View next topic |
| Author |
Message |
Henk van Winkoop Guest
|
Posted: Sun Feb 12, 2006 3:03 pm Post subject: Picture on TPanel |
|
|
Hello,
I developped an application using a TPanel as a base-working-ground that
covers all client window.
During runtime I can handle (place/erase/move) all kinds of objects on this
TPanel.
Now I would like to have a background picture on this TPanel for 'beauty'
reason.
This is not possible.
I cannot use a TImage as a base-working-ground because I use many specific
TPanel properties like 'ControlCount' which are not part of a TImage.
Putting a TPanel over a TImage does not work as TPanel can not be made
transparant. (As far as I know).
Somebody has any idea how to put a picture 'under' a TPanel?
Regards,
Henk |
|
| Back to top |
|
 |
HF Guest
|
Posted: Sun Feb 12, 2006 4:03 pm Post subject: Re: Picture on TPanel |
|
|
You can put a TImage on the Panel with Align=alClient , Stretch= true so
will cover whole Panel.
That TImage will be also in Controls array of your Panel so take care that
you don't delete it .
-minas |
|
| Back to top |
|
 |
Henk van Winkoop Guest
|
Posted: Sun Feb 12, 2006 9:03 pm Post subject: Re: Picture on TPanel |
|
|
Thanks for your advise,
I used a little trick to solve the problem,
I just put an TImage on the TPanel and with all
Controls/ControlCount actions I dynamically cast/check
for non-TImage and use as object count 'ControlCount-1'
No nice programming but it work wonderfull,
Regards,
Henk
"HF" <min_charLOOK@ATyahooADD_DOTgr (HellenicFire)> schreef in bericht
news:43ef55c4 (AT) newsgroups (DOT) borland.com...
| Quote: | You can put a TImage on the Panel with Align=alClient , Stretch= true so
will cover whole Panel.
That TImage will be also in Controls array of your Panel so take care that
you don't delete it .
-minas
|
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Sun Feb 12, 2006 9:03 pm Post subject: Re: Picture on TPanel |
|
|
HF wrote:
| Quote: | That TImage will be also in Controls array of your Panel so take care that
you don't delete it .
|
You can delete it if you want. But you need -at program end, or at deleting
the form- not if you asigned an Owner. The Owner does not have to be the TPanel.
Hans. |
|
| Back to top |
|
 |
JD Guest
|
Posted: Mon Feb 13, 2006 6:03 am Post subject: Re: Picture on TPanel |
|
|
"HF" <min_charLOOK@ATyahooADD_DOTgr (HellenicFire)> wrote:
| Quote: |
[...] That TImage will be also in Controls array of your
Panel so take care that you don't delete it .
|
The VCL is designed to cope with such things as dynamically
adding and removing controls. Dynamically deleting the TPanel
or the TImage is perfectly ok. However, issues may arise with
code that executes after the object's destruction but that's
the programers responsibility.
~ JD |
|
| Back to top |
|
 |
|