Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using TRichEdit

Status
Not open for further replies.

Spent

Programmer
Mar 20, 2003
100
BG
When I use TRichEdit
var xR:TRichEdit;
messages:String;
i:Integer;
----
begin
xR:=TRichEdit.Create(self);
// some init code
....

for i:=1 to 30 do
xR.Lines.Add( messages + IntToStr(i) );
end;

When I add more lines than the richedit height, the richedit's vscrollbar do not scroll down to the
bottom and the last messages can not be seen.Can you tell me how to set the vscrollbar of the
richedit to the bottom ?
Thank you

Spent
mail:spentbg@yahoo.com
 
Three options:

with Richedit1 do
begin
SelStart:=Length(Text);
Perform(EM_SCROLLCARET,0,0);
end;

Richedit1.Perform(WM_VSCROLL,SB_BOTTOM,0);
{May wish to combine with SelStart:=Length(Text)}

Richedit1.Perform(EM_LINESCROLL,0,High(integer));
{Not so good}


If you are finding TRichEdit limiting, check out WPTools.com.

Have fun
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top