Lets say I want to put 2 panels on a form. The following is the
property of the 2 panels (namely PanelA and PanelB) :
PanelA.Align := alBottom;
PanelB.Align := alLeft;
The effect is as follows :
|--------|----------------------------------|
| | |
| | |
| PanelB | |
| | |
| | |
---------|-----------------------------------
| |
| PanelA |
| |
|-------------------------------------------|
But I want the following :
|--------|----------------------------------|
| | |
| | |
| PanelB | |
| | |
| | |
| |----------------------------------|
| | |
| | PanelA |
| | |
|--------|----------------------------------|
Question is : "How do I achieve this?" For your info, the alTop and
alBottom has got priority of overriding alLeft and alRight. Please
advise soon. BTW, do email me a copy of your reply when you post your
solutions...
Thank you in advance.
Finest Regards,
Sam
/***************************************************
/*
/* From the desk of Song Weng Sam
/*
/* Email : son...@pacific.net.sg
/* Pager : 9-492-4014
/*
/***************************************************
[ Placing two panels on a form, one with align property of alLeft, and
one with align property of alBottom. The Second panel will always take
the whole of the bottom of the area, and the first panel will be
placed above it. This is not always the required result, ie:
+-+ +-+
| | Got This | |Wanted this
+-+---+ | +---+
| | | | |
+-----+ +-+---+
]
I always use a third panel, as follows:
Create Panel1
Set Align to alLeft
Create Panel2
Set Align to AlClient
Set BevelOuter to BvNone
Create Panel3 on Panel2
Set Align to AlBottom
This will appear and behave exactly as you wanted, unless you want access to
the form canvas in the upper right corner, in which case you will have to
align the panels manually using the form OnResize event:
...
Panel1.Height := ClientHeight;
Panel2.Top := ClientHeight - Panel2.Height;
Panel2.Width := ClientWidth - Panel1.Width;
...
Just leave the align property at alNone and position the panels correctly on
the form for the initial display, and whenever the form is resized, they
will be resized to follow. This is most useful for resizing edit boxes when
the form has been resized (I most notice this behaviour in Netscape, for the
URL edit box)
TTFN
Eric Kendrick
--
Eric Kendrick // er...@oasis.icl.co.uk
Sounds like you need to use "Send to Back" to move Panel A to the back
of Panel B.
I cannot do this because I wanted to display the whole of Panel2. If
I made Panel3 as a child of Panel2, it will cause part of Panel2 to be
hidden. This is not desirable. Further to that, as the program
border is sizeable, the panels are resized dynamically.
Any other suggestions???
>[ Placing two panels on a form, one with align property of alLeft, and
> one with align property of alBottom. The Second panel will always take
> the whole of the bottom of the area, and the first panel will be
> placed above it. This is not always the required result, ie:
[snip]
> Create Panel1
> Set Align to alLeft
> Create Panel2
> Set Align to AlClient
> Set BevelOuter to BvNone
> Create Panel3 on Panel2
> Set Align to AlBottom
\||||||||/
| ~ ~ |
(| @ @ |)
*****oOOo***(__)***oOOo********
From the desk of Song Weng Sam
Email : son...@pacific.net.sg
Pager : 9-492-4014
*****oOOo**********oOOo********
Get A 3rd Panel Aligned to alClient and make PANEL C a child of that.
Regards
Peter
>The effect is as follows :
>
>|--------|----------------------------------|
>| | |
>| | |
>| PanelB | |
>| | |
>| | |
>---------|-----------------------------------
>| |
>| PanelA |
>| |
>|-------------------------------------------|
>
>
>But I want the following :
>
>|--------|----------------------------------|
>| | |
>| | |
>| PanelB | |
>| | |
>| | |
>| |----------------------------------|
>| | |
>| | PanelA |
>| | |
>|--------|----------------------------------|
>
>Question is : "How do I achieve this?" For your info, the alTop and
>alBottom has got priority of overriding alLeft and alRight. Please
>advise soon. BTW, do email me a copy of your reply when you post your
>solutions...
I had this problem also a few days ago. The only solution I found was
to use a third panel.
Place this third panel besides panel B with align alClient
You can then place panel A in the third panel with an alignment of
alBottom.
Wim Van Goethem