?
Solved

How get 1 line from a memo by clicking

Posted on 2003-02-19
4
Medium Priority
?
144 Views
Last Modified: 2010-04-04
How can I take 1 line (show it in label1) out a memo by double clicking on it?

procedure TForm1.Memo1DblClick(Sender: TObject);
var X:integer;
begin
  X:=            ;
  label1.Caption:=Memo1.Lines[X];
end;

My problem is the 'X'
0
Comment
Question by:jurgentje
[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
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7981268
too less points
0
 

Accepted Solution

by:
Entrodus earned 120 total points
ID: 7981572
procedure TForm1.Memo1DblClick(Sender: TObject);
var
  Y: Integer;
begin
  Y:= memo1.CaretPos.Y;
  label1.Caption:=Memo1.Lines[X];
end;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7981676
an error entrodus

this
label1.Caption:=Memo1.Lines[X];

should be
label1.Caption:=Memo1.Lines[Y];

btw works only with version d4 and higher not with d3

meikl ;-)
0
 

Author Comment

by:jurgentje
ID: 7981789
Thanks for the code, Entrodus ;)
I give a "Good" cause of the little mistake.
Correction: see kretzschmar's post.
0

Featured Post

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
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: …
Suggested Courses

762 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