Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-04

[newbie question] how to make resizable tmemo?

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

waldo kitty

in the recent playing around with the code in the "flicker" thread, i wanted to make the tmemo automatically resize to fit the form when it is resized and to keep the button where i placed it and visible... the align and alignment options confuse this old boy as does much of the GUI world of coding... i had some luck with a groupbox but it wasn't satisfactory...

can someone please explain, in very simple terms and steps, how to accomplish this? i have no delphi books available and what i have looked at online has only served to confuse me further :/

advTHANKSance :)

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Edilson Vieira
to waldo kitty

Hi waldo,

  Memo1.Align:=alClient;

This will make the Memo sized to form size.

  Memo1.Alignment:=taRightJustify;

This will make the text inside the Memo be right justified.

To mantain a visible button, put it inside a panel and set the Align
property of the panel to alTop;

It runs ok for me.

Hope it helps!

Ed.

2013/4/30 waldo kitty

Show quoted text 24 lines
in the recent playing around with the code in the "flicker" thread, i wanted to make the tmemo automatically resize to fit the form when it is resized and to keep the button where i placed it and visible... the align and alignment options confuse this old boy as does much of the GUI world of coding... i had some luck with a groupbox but it wasn't satisfactory... can someone please explain, in very simple terms and steps, how to accomplish this? i have no delphi books available and what i have looked at online has only served to confuse me further :/ advTHANKSance :) -- NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted. -- ______________________________**_________________ Lazarus mailing list .**freepascal.org http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130430/9ba533be/attachment.html>

Reply by email

Sven Barth
to waldo kitty: in the recent playing around with the code in the "flicker" thread, i wanted to make the…
waldo kitty wrote 11 lines
in the recent playing around with the code in the "flicker" thread, i wanted to make the tmemo automatically resize to fit the form when it is resized and to keep the button where i placed it and visible... the align and alignment options confuse this old boy as does much of the GUI world of coding... i had some luck with a groupbox but it wasn't satisfactory... can someone please explain, in very simple terms and steps, how to accomplish this? i have no delphi books available and what i have looked at online has only served to confuse me further :/

The Anchors and Align properties are what you need here. Align allows you to tell a control to always stay at the top/left/right/bottom or to always fill the remaining client area that these controls leave. With Anchors you can basically "pin" a side to its parent (e.g. a form or a panel). So by setting a memo's anchors for all for sides to true (or setting in code the anchors to [akLeft, akTop, akRight, akBottom]) will result in the memo resizing with the underlying control (e.g. the form).

For more (also advanced) information you can (and maybe even should) take a look here: http://wiki.freepascal.org/Autosize_/_Layout

Regards,
Sven

Reply by email