Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TEMO With Line numbering on the left

Posted on 2003-10-28
12
Medium Priority
?
467 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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