Solved

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

Posted on 1997-08-01
3
469 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 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now