Solved

I can't make scrollBar   procede with loding new text in memo

Posted on 2007-11-27
4
250 Views
Last Modified: 2010-04-05
 I'm  reading text from .txt file in memo1.  With every new opening of the form am adding new text
 to become larger than memo window .  I have scroll bars to, but can't make memo show the last text.
 What must i do?
0
Comment
Question by:pr2501
  • 2
4 Comments
 
LVL 13

Expert Comment

by:rfwoolf
ID: 20360496
What do you mean? Just scroll down.Are you asking how to scroll down programmatically?
0
 

Author Comment

by:pr2501
ID: 20363865

On opening of the window the memo scroll bar  blue square rectangle is on the top of vertical  scrollbar rectangle.

have to make it to be on opening on the  bottom?
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 20363940
a sample

procedure TForm1.Button1Click(Sender: TObject);
begin
  if opendialog1.execute then
  begin
    memo1.Lines.LoadFromFile(opendialog1.filename);
    memo1.SelStart := length(memo1.Text);
    memo1.Perform(EM_ScrollCaret,0,0);
  end;
end;

meikl ;-)
0
 

Author Comment

by:pr2501
ID: 20394772
Way can't make it work in next code?
procedure TForm2.Beri(Ime:string);

    var

          podatki1: textfile;

          vrstica: string;

  begin

     AssignFile(podatki1,Ime);

     Reset(podatki1);

     While not EOF (podatki1) do begin

     ReadLn(podatki1,vrstica);

     F.Memo1.Lines.Add (vrstica);

     end;
 

     F.  memo1.SelStart := length(memo1.Text);

     F.memo1.Perform(EM_ScrollCaret,0,0);

     CloseFile(podatki1);
 

  end;

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now