Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1997-08-01
3
Medium Priority
?
514 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

721 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