You need following:<br>1. Drop additional panel (P3) on Form<br>2. Make its border invisible and Aligh = alLeft<br>3. Drop P2 on P3 and make P2.Aligh = alBottom<br>4. Drop P1 on Form and make P1.Aligh = alRight<br><br>As I know, it is the only way...<br>
<br><div class="gmail_quote">2010/10/4 Graeme Geldenhuys <span dir="ltr"><<a href="mailto:graemeg.lists@gmail.com">graemeg.lists@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I came across something unexpected today. I was under the impression<br>
that the order in which you set the Align property, that's the order<br>
in which the components align themselves with the parent and<br>
neighbouring components.<br>
<br>
In this example, I have a Form with two Panels (P1 & P2).<br>
Order in which I did things:<br>
* Create new Form<br>
* Drop panel P1 on the Form<br>
* Set P1.Align := alRight<br>
* Drop panel P2 on the Form<br>
* Set P2.Align := alBottom.<br>
<br>
What I expected was Figure 1, where P1 is the full height of the form<br>
and P2 is the Width of the Form minus P1.Width. But instead I got<br>
Figure 2. I tried this in both Delphi 7 and Lazarus. It seems the<br>
alignment order is irrelevant to the component creation order or<br>
irrelevant to what order you set the Align properties. If fact,<br>
alignment is always process in the following hard-coded order: Top,<br>
Bottom, Left, Right, Client...<br>
<br>
As I said, for some reason I was under the impression (even from<br>
delphi days) that the order in which you activate the Align<br>
properties, that's the order in which the alignment is applied. So<br>
what must I do to get Figure 1? Use Anchor's instead of Align<br>
properties?<br>
<br>
<br>
[... you need a mono font to see ascii art...]<br>
<br>
Figure 1:<br>
+-------------+-------+<br>
| | |<br>
| | |<br>
| client | P1 |<br>
| | |<br>
| | |<br>
| | |<br>
+-------------+ |<br>
| P2 | |<br>
+-------------+-------+<br>
<br>
<br>
Figure 2:<br>
+-------------+-------+<br>
| | |<br>
| | |<br>
| client | P1 |<br>
| | |<br>
| | |<br>
| | |<br>
+-------------+-------+<br>
| P2 |<br>
+---------------------+<br>
<br>
<br>
<br>
<br>
--<br>
Regards,<br>
- Graeme -<br>
<br>
<br>
_______________________________________________<br>
fpGUI - a cross-platform Free Pascal GUI toolkit<br>
<a href="http://opensoft.homeip.net:8080/fpgui/" target="_blank">http://opensoft.homeip.net:8080/fpgui/</a><br>
<font color="#888888"><br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</font></blockquote></div><br>