<div>Thank you very much.</div><div><br></div><div><br></div><br><br><div class="gmail_quote">2009/6/30 Graeme Geldenhuys <span dir="ltr"><<a href="mailto:graemeg@opensoft.homeip.net">graemeg@opensoft.homeip.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">kota kota wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How can i make a window to shrink instead of losing its elements(buttons, labels) when it is being re-sized ?<br>
</blockquote>
<br></div>
Use the Anchor property. By default the anTop and anLeft anchors are set on all components. If you used the UI Designer to visually design your form, then select the component (for example a Button), then in the Object Inspector windows click the Right and Botton anchor buttons and deselect (click them to toggle them) default Top and Left anchors.<br>
<br>
The UI Designer writes the gui design into a method called AfterCreate() and it will look something like show below.<br>
<br>
========================<br>
Button1 := TfpgButton.Create(self);<br>
with Button1 do<br>
begin<br>
Name := 'Button1';<br>
SetPosition(504, 420, 80, 24);<br>
Anchors := [anRight,anBottom];<br>
Text := 'Button';<br>
FontDesc := '#Label1';<br>
Hint := '';<br>
ImageName := '';<br>
TabOrder := 15;<br>
end;<br>
========================<br>
<br>
You can set the Anchors at design time and resize the design form to see what happens. For example, setting all four anchors, the component will grow and shrink as the form is resized.<br>
<br>
<br>
Regards,<br>
- Graeme -<br>
<br>
________________________________________________<br>
fpGUI - a cross-platform Free Pascal GUI toolkit<br>
<a href="http://opensoft.homeip.net/fpgui/" target="_blank">http://opensoft.homeip.net/fpgui/</a><br>
<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</blockquote></div><br>