Show last lines of memo not first

At last I've found you...


I am programmatically building a memo but the height of the 
component is less than the actual text. I want to show the last 
line entered - I have tried selstart etc but it doesn't change 
the text visible in the memo.

Pat Bell

Using Virtual Access
http://www.soft-shop.com
0
Patrick
8/20/2008 12:32:23 PM
embarcadero.delphi.nativeapi 1236 articles. 1 followers. Follow

4 Replies
3457 Views

Similar Articles

[PageSpeed] 37
Get it on Google Play
Get it on Apple App Store

Patrick Bell wrote:
> At last I've found you...
> 
> 
> I am programmatically building a memo but the height of the 
> component is less than the actual text. I want to show the last 
> line entered - I have tried selstart etc but it doesn't change 
> the text visible in the memo.
> 
> Pat Bell
> 
> Using Virtual Access
> http://www.soft-shop.com

Pat,

Try the following:

// move the caret to first char on first line
Control.Perform(EM_SCROLLCARET, 0, 0);
// now scroll forward to desired line
Control.Perform(EM_LINESCROLL, 0, LineNbr);

John Furlong
0
John
8/20/2008 12:38:54 PM
"Patrick Bell" <pat@patbell.co.uk> wrote in message 
news:4877@forums.codegear.com...

> I have tried selstart etc but it doesn't change the text visible in the 
> memo.

You have to scroll the Memo manually, ie:

    Memo1.SelStart := Memo1.GetTextLen;
    Memo1.SelLength := 0;
    Memo1.Perform(EM_SCROLLCARET, 0, 0);


Gambit
0
Remy
8/20/2008 4:57:33 PM
Thanks that works a treat.

In article <4881@forums.codegear.com>, John Furlong wrote:
> Patrick Bell wrote:
> > At last I've found you...
> > 
> > 
> > I am programmatically building a memo but the height of the 
> > component is less than the actual text. I want to show the last 
> > line entered - I have tried selstart etc but it doesn't change 
> > the text visible in the memo.
> > 
> > Pat Bell
> > 
> > Using Virtual Access
> > http://www.soft-shop.com
> 
> Pat,
> 
> Try the following:
> 
> // move the caret to first char on first line
> Control.Perform(EM_SCROLLCARET, 0, 0);
> // now scroll forward to desired line
> Control.Perform(EM_LINESCROLL, 0, LineNbr);
> 
> John Furlong
>


Pat Bell

Using Virtual Access
http://www.soft-shop.com
0
Patrick
10/23/2008 9:58:58 AM
Thanks, I don't know what I'd do without this ng

:-)


In article <4989@forums.codegear.com>, Remy Lebeau (TeamB) wrote:
> "Patrick Bell" <pat@patbell.co.uk> wrote in message 
> news:4877@forums.codegear.com...
> 
> > I have tried selstart etc but it doesn't change the text visible in the 
> > memo.
> 
> You have to scroll the Memo manually, ie:
> 
>     Memo1.SelStart := Memo1.GetTextLen;
>     Memo1.SelLength := 0;
>     Memo1.Perform(EM_SCROLLCARET, 0, 0);
> 
> Gambit
>


Pat Bell

Using Virtual Access
http://www.soft-shop.com
0
Patrick
10/23/2008 9:59:00 AM
Reply: