Board index » delphi » Richedit Scrollbars

Richedit Scrollbars

Ok...i'm invoking a findtext command in a richedit?!
using this code....

procedure TForm1.Image3Click(Sender: TObject);

begin
  with RichEdit1 do
  begin
    { begin the search after the current selection if there is one }
    { otherwise, begin at the start of the text }
    if SelLength <> 0 then

      StartPos := SelStart + SelLength
    else

      StartPos := 0;

    { ToEnd is the length from StartPos to the end of the text in the rich
edit control }

    ToEnd := Length(Text) - StartPos;

    FoundAt := FindText(Edit3.Text, StartPos, ToEnd, [stMatchCase]);
    if FoundAt <> -1 then
      ShowStuff
      else
    MessageDlg('Sorry, can''t find anything more.', mtinformation, [mbok],
0);
    end;
  end;

procedure TForm1.ShowStuff;
begin
Richedit1.SetFocus;
Richedit1.SelStart := FoundAt;
Richedit1.SelLength := Length(Edit3.Text);
end;

My question is HOW do i get the scrollbars to center the text it found i.e.
if the text is half way down the text document, how do i get the scrollbar
to center!

 

Re:Richedit Scrollbars


In alt.online-service.delphi Tim Larcos <tlar...@optushome.com.au> wrote:
Quote
> ...

the best help i can offer is for you to repost your question on one of
the delphi language newsgroups rather than every newsgroup on the net
containing the word delphi in it's name, and in particular not the
newsgroup for the online-service delphi, which is what this group is.
--
 ldj <larry johnson> not EEO, EOO Equal Opportunity Offender
 Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227: Any and
all non-solicited commercial e-mail sent to this address is subject to a
download and archival fee of $500 US per day.

Other Threads