Board index » delphi » Search for Control like TDBMemo with Tabs-Spacing

Search for Control like TDBMemo with Tabs-Spacing

Hallo,

Do You know any control for Delphi5 that allows fexible tab spacing?
When you use TDBMEmo the tab-spacing is fix and that's my problem!
I have to set only one Tab-spacing to probably 40 Characters
the text is plain ascii text formatted with CRLF and TAB
 - that's all -

Thank you for Response

Bernhard Hartl

 

Re:Search for Control like TDBMemo with Tabs-Spacing


Quote
In article <3a9e0459$1_2@dnews>, Bernhard Hartl wrote:
> Do You know any control for Delphi5 that allows fexible tab spacing?
> When you use TDBMEmo the tab-spacing is fix and that's my problem!
> I have to set only one Tab-spacing to probably 40 Characters
> the text is plain ascii text formatted with CRLF and TAB

Bernhard,

you can set tabstops in a memo by sending a EM_SETTABSTOPS message to
it.

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;

Quote

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.

Re:Search for Control like TDBMemo with Tabs-Spacing


Hallo Peter

Thank you very very mutch

Bernhard Hartl

"Peter Below (TeamB)" <100113.1...@compuXXserve.com> schrieb im Newsbeitrag
news:VA.00006abf.0089dd0e@antispam.compuserve.com...

Quote
> In article <3a9e0459$1_2@dnews>, Bernhard Hartl wrote:
> > Do You know any control for Delphi5 that allows fexible tab spacing?
> > When you use TDBMEmo the tab-spacing is fix and that's my problem!
> > I have to set only one Tab-spacing to probably 40 Characters
> > the text is plain ascii text formatted with CRLF and TAB

> Bernhard,

> you can set tabstops in a memo by sending a EM_SETTABSTOPS message to
> it.

> 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;

> Peter Below (TeamB)  100113.1...@compuserve.com)
> No e-mail responses, please, unless explicitly requested!
> Note: I'm unable to visit the newsgroups every day at the moment,
> so be patient if you don't get a reply immediately.

Other Threads