• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

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?
0
waipahu
Asked:
waipahu
  • 3
  • 2
1 Solution
 
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
 
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now