Solved

TEMO With Line numbering on the left

Posted on 2003-10-28
12
461 Views
Last Modified: 2010-04-05
I need to display the linenumbers to the left of a TMEMO or something like that ...

Did some body have a component like that ...
0
Comment
Question by:gags03
  • 6
  • 3
  • 3
12 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9634664
Memo1.Lines.Add(IntToStr(Memo1.Lines.Count) + ': ' + str);
0
 

Author Comment

by:gags03
ID: 9634796
oups it's not exactly want I want ...

I don't want to add the number in the text ...

I want to do a small editor with the line numbering in the left, I don't want to modfify the text ...

Cause I used Memo1.lines.loadfromfile ... or savetofile ... Then if I do like you said, I will save the line numbering ...

0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9634861
Then try to use TStringGrid
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9634909
procedure SaveToFile
var i: integer;
begin
   for i:=0 to pred(Memo1.Lines.Count) do begin
      Delete(Memo1.Lines[i], 1, Pos(':', Memo1.Lines[i]) + 1);
   end;
  Memo1.lines.savetofile ;
end;
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9634934
procedure LoadFromFile;
var i: integer;
begin
  Memo1.lines.loadfromfile;
  for i:=0 to pred(Memo1.Lines.Count) do begin
     Memo1.Lines[i] := IntToStr(i) + ': ' + Memo1.Lines[i];
  end;
end;
0
 

Author Comment

by:gags03
ID: 9635312
GloomFriar : You are funny ...

For 250 points I expected an answer better than a for lop with modified text ...

Your grid answer was not to bad, but I'm probably not the only one who need to show a line number in a memo component ...

I search more a component or an easy way to show the line number ( none modifiable by the user ) ...
0
 
LVL 4

Expert Comment

by:nestorua
ID: 9635335
HI,
If you want to place numbers in Memo area or simply right to the left but outside its area. If the second then you could place another memo to the left from the main memo and write there numbers exactly the same font you use in your main memo and exactly as many as number of lines in your main memo.
Sincerely,
Serhiy.
0
 

Author Comment

by:gags03
ID: 9635397
IT's a good idea, but did you have a way to have the corresponding line when the user move the scrollbar ?
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9635718
Put both the memos on TScrollBox
0
 
LVL 4

Expert Comment

by:nestorua
ID: 9635748
Or use SBM_GETSCROLLINFO and SBM_SETSCROLLINFO messages.
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9635759
>GloomFriar : You are funny ...
>I'm probably not the only one who need to show a line number in a memo component
I've never seen the editor made in a similar way.
Usually in the status the bar is injected number of current line.
You've asked how "to show a line number in a memo component"  and I has shown you a way to do that.
0
 
LVL 4

Accepted Solution

by:
nestorua earned 250 total points
ID: 9635877
Try www.tmssoftware.com address.
You can find there the Memo component you want.
But I think it's not freeware.
If I remember more I'll inform you.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

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…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

778 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