Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1997-08-01
3
Medium Priority
?
515 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
  • 2
3 Comments
 

Author Comment

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

Accepted Solution

by:
ronit051397 earned 600 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

783 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