How do you issue a scroll top in the memo field?

I have a memo field on my form. I populate it from a
text file so it scrolls down. However, after the load
is completed, i want to position to the first line.  Right
now the user would have to move it manually
using the scroll bar.

Any ideas?
waipahuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
hi waipahu,

? happens not to me,
if i use the TMemo.Lines.LoadFromFile-method

if u use another method for loading the text, then try
memo1.selstart := 0;

meikl
0
waipahuAuthor Commented:
I perform the following code until a certain condition
      form1.memo1.Lines.Add(form1.rpt['line']);
      form1.rpt.Next;

after i'm finish loading, i want to set it to the top,
not the bottom.

sorry, i'm loading lines from a dbase file.
I'm not loading the whole file but a few records.

Selstart :=0 will not position it to the first line.
0
waipahuAuthor Commented:
I guess a general question regarding the memo field
is how do you control movement within the memo field?

For instance, what if i had a UP button and a Down Button,
what statement would I use to move up one line or
move down one line in the memo field? Or go top or
go bottom within the memo field.

I guess it's a navigation question.

Your help would be greatly welcomed.

Thank you very much experts :)

0
kretzschmarCommented:
hi again waipahu,
well there is missed a line

  memo1.selstart := 0;
  memo1.perform(EM_SCROLLCARET,0,0);

this will scroll the caret into the visible area

other message is
EM_SCROLL
with one of this the wparam values

SB_LINEDOWN      Scrolls down one line.
SB_LINEUP      Scrolls up one line.
SB_PAGEDOWN      Scrolls down one page.
SB_PAGEUP      Scrolls up one page.

meikl
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
waipahuAuthor Commented:
Thank you for your help.
It seems to be working. I think I have to
do something to get it working the way i want it to.
Thank you so much!
I really appreciate your help :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.