?
Solved

TEMO With Line numbering on the left

Posted on 2003-10-28
12
Medium Priority
?
466 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
Independent Software Vendors: 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 1000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

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…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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