Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

RichEdit - FindDialog - Scroll-Down - Scroll-Across

Hello All;

   I found the following code that will make the TRichEdit [Scroll-Down] while doing a Search
[ RichEdit.Perform(EM_SCROLL,SB_LINEDOWN,0); ]

But now, I need to find something that will make the TRichEdit [Scroll-Across] while doing a Search?

Any idea's on this one?

Thanks All;

Carrzkiss
Avatar of Russell Libby
Russell Libby
Flag of United States of America image


If the cursor (SelStart) is set to the desired position to be scrolled into view, you can perform the following:

  RichEdit.Perform(EM_SCROLLCARET, 0, 0);

Regards,
Russell
Avatar of Wayne Barron

ASKER

tried that.
This is what I am using:

FindDialog1.Position := Point(RichEdit1.Left + RichEdit1.Width, RichEdit1.Top);
FindDialog1.Execute;
FindDialog1.Perform(EM_SCROLL,SB_LINEDOWN,0);
FindDialog1.Perform(EM_SCROLLCARET,0,0);
RichEdit1.SelStart := RichEdit1.GetTextLen;


I have tried to put the: RichEdit.Perform(EM_SCROLLCARET, 0, 0);
At the bottom line, but still no go.

Can the    ,0,0
Be changed? if so, could you explain what each of them will do?

Why are you having the **dialog** perform the EM_SCROLL and EM_SCROLLCARET messages? The RichEdit needs to perform the messages. And why are you setting the SelStart to the full text text len of the control, vs the text that you are searching for?

Russell
ASKER CERTIFIED SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That works perfect.
I just have to find out "Why" it is not working in my project?
Very strang, there is nothing different about the the 2-RichEdits.
But your code with scroll to the right,
Mine will not?

Just going to have to do some checking and find out what is going on.

----
As for the code that I supplied that I was using.
That is how I found it.
Should have done some more research on the code before using it.

Thanks Russell. (Added another [125] to the total)
Wayne
Anytime Wayne, thanks much ;-)

Regards,
Russell