Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can we make two column on memo?

1,016 views
Skip to first unread message

Reid

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Can we make two columns on memo? I would like to be able to put number of
column on memo. Also same on quickreport too. Please help me on this. An
example program or source code would be great.

Reid

Peter Below

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
In article <87pk19$9b...@bornews.borland.com>, Reid wrote:
> Can we make two columns on memo?

Kind of. Both tMemo and Trichedit support tabstops (the plain left-aligning
kind only), so you can get a a string like

'column 1'#9'column 2'

to display as

column 1 column 2

You need to go to the API to set tabstop positions in a TMemo.

Setting tabstops in a memo control

procedure TScratchMain.SpeedButton2Click(Sender: TObject);
Var
tabs: Array [0..2] of Integer;
Begin
(* set first tabstop at 12, second at 24, third at 44 character
position, using the average width as base, converted to dialog
units. 4 dialog units make one average char width. *)
tabs[0] := 12 * 4;
tabs[1] := 24 * 4;
tabs[2] := 44 * 4;
Memo1.Clear;
Memo1.Lines.Add('01234567890123456789012345678901234567890123456789');
Memo1.Lines.Add('Start'#9'One'#9'Two'#9'Three');
Memo1.Perform( EM_SETTABSTOPS, 3, LongInt(@tabs));
Memo1.Refresh;
end;

TRichedit has a Tab property as part of the Paragraph property. It expects
tab positions to be specified in points (1/72 inch, not pixels as the help
tells you).
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Sent using Virtual Access 5.00 - download your freeware copy now
http://www.atlantic-coast.com/downloads/vasetup.exe

Richard Hughes

unread,
Feb 11, 2000, 3:00:00 AM2/11/00
to

If you just need to display text, put 3 memos side by side on a panel,
size the center memo to your desired column width, set all the border
styles to bsNone. This won't work, of course, if the user needs to add
anything to the left side memo, i.e. text will not flow from the left
column to the right. If you look at Torry's page, I believe you'll find
some richedit components that are practically word processors.
http://www.torry.ru/

Richard Hughes

0 new messages