Solved

Memo/Richedit - How to define own Tabstop-lengths?

Posted on 1997-08-01
3
507 Views
Last Modified: 2010-04-04
How can I define the length of each Tabstop
in a TRichedit?
The predefined Tabstops are to wide for my application,
so i would like to decrease them.
Example:


Example Line
________Here we´re at 1st tab________ Here we 2nd tab

but i want to have something like

Example Line
___Here we´re at 1st tab___Here we 2nd tab

Thanks!
0
Comment
Question by:cydo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:cydo
ID: 1340348
Edited text of question
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 200 total points
ID: 1340349
You should send the message EM_SETPARAFORMAT.

uses richedit
procedure....
var FFormat: TPARAFORMAT;
begin
//set the FFormat values
with FFormat do
begin
.
.
cTabCount:=...
rgxTabs:=...
end;
RichEdit1.Perform(EM_SETPARAFORMAT,0,FFormat);
end;
0
 

Author Comment

by:cydo
ID: 1340350
This is the complete example for the
setTAB procedure (done with the help of ronit´s answer):

var FFormat: TParaformat;

begin
 with FFormat do
  begin
   FillChar(FFormat, SizeOf(TParaFormat), 0);
   cbSize := SizeOf(TParaFormat);
   cTabCount:=4;
   rgxTabs[0]:=5;
   rgxTabs[1]:=15;
   rgxTabs[2]:=25;
   rgxTabs[3]:=40;
 end;
 Richedit1.Perform(EM_SETPARAFORMAT,0,LPARAM(@FFormat));
end;

but anyway, with the help of ronit´s EM_SETPARAFORMAT
i found that this setTab procedure is already wrapped into
delphi. So here´s an easier solution ;)

 Richedit1.SelectALL; {* Select all paragraphs *}

 RichEdit1.Paragraph.tab[0]:=5;
 RichEdit1.Paragraph.tab[1]:=15;
 RichEdit1.Paragraph.tab[2]:=25;
 RichEdit1.Paragraph.tab[3]:=35;
 RichEdit1.Paragraph.tab[4]:=45;

 RichEdit1.Sellength:=0; {* deselect *}

The .tab property calls (if written) the SetTab proc of
TParaAttributes, which does nearly the same as the above procedure ;)

Thanks for your help Ronit!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question