Solved

TEMO With Line numbering on the left

Posted on 2003-10-28
12
464 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
[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
  • 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
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!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
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 …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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