[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Move botton of a TMemo or TRichEdit

I use the following code to fill in a TRichEdit with some text lines (Object is either a TMemo or a TRichEdit component)

     Object.Lines.Add(Text]);
     SendMessage(Object.Handle,WM_VSCroll,SB_LINEDOWN,0);

If Text comes visually on one single line, it's okay
But if it comes on several line (longer that the object width), then the text is not entirely visible at the botton
How can I really force it to be ?
0
LeTay
Asked:
LeTay
  • 2
1 Solution
 
Ephraim WangoyaCommented:
use this
Object.Perform(WM_VSCROLL,SB_BOTTOM,SB_THUMBTRACK)

or
SendMessage(Object.Handle, EM_SCROLLCARET, 0, 0);
0
 
Ephraim WangoyaCommented:

or even simpler

SendMessage(Object.Handle, EM_LINESCROLL, 0, Object.Lines.Count);
0
 
LeTayAuthor Commented:
Exactly what I was looking for !
Many thanks !
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

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