Solved

EM_LINESCROLL

Posted on 1999-01-22
7
1,661 Views
Last Modified: 2010-04-04
Hi everybody!
I'm having probs. I want to implement my own scroll events
to a TRichEdit Component. ( Let's call it RE1 ) By the way:
The direction I want to scroll is X (to the right), not Y (down)

Forget about RE1.ScrollBy( -7, 0), it doesn't bring up the result I want.
I tried RE1.Perform ( EM_LINESCROLL, 7, 0) but that doesn't bring up any result.

Strange enough a (EM_LINESCROLL 0, 10) does scroll the text up. As a matter of fact, it scrolls it right out of my RE1 Window, although the message EM_LINESCROLL is defined => "if the current line plus the number of lines specified by the cyScroll param ( 10 ) exceeds the total number of lines, the value is adjusted so that the last line is scrolled to the top."
Sorry, borlandinprise guys, not in my RE1 !

But back to my prob:
I also tried a SendMessage with EN_HSCROLL, but that doesn't bring up any effect either.

Any ideas why EM_LINESCROLL doesn't take any effect if I try to scroll to the right ?

Oh, by the way: EM_SCROLLCARET does work, but again isn't what I want.

Greetings, Oli
0
Comment
Question by:Oli2
  • 5
7 Comments
 
LVL 1

Author Comment

by:Oli2
Comment Utility
Adjusted points to 100
0
 
LVL 1

Author Comment

by:Oli2
Comment Utility
Edited text of question
0
 
LVL 1

Author Comment

by:Oli2
Comment Utility
Edited text of question
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Author Comment

by:Oli2
Comment Utility
Adjusted points to 150
0
 
LVL 44

Accepted Solution

by:
bruintje earned 150 total points
Comment Utility
Hi Oli,

I don't know why EM_LINESCROLL didn't work, couldn't find a direct right scroll command in any implementation except for the J++ class wrapper around the Richedit control.

Got to work it out myself, after trying ScrollWindowEx that worked with SB_PAGEDOWN I did the following

procedure TForm1.Button3Click(Sender: TObject);//button3 is the 3rd different implementation :O)
var
  CountLines: Integer;
  I  : Integer;
begin
  CountLines := 50; //your value
  try
    for I := 0 to Countlines - 1 do begin
      SendMessage(Richedit1.Handle, { HWND of the Memo Control }
        WM_HSCROLL, { Windows Message }
        SB_LINERIGHT, { Scroll Command }
        0) { Not Used }
    end;
  except on E: Exception do
      Showmessage('Error scrolling lines down the reason > ' + E.Message);
  end
end;

And it worked for scrolling to the right.
btw You can also use ScrollWindowEx in this way to scroll in two dimensions at the same time :O).

Why the EM_LINESCROLL didn't work I don't know, but I hope this will get you further.
:O)
brUINTje.
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
Or look at GetScrollInfo/SetScrollInfo...

Regards, Madshi.
0
 
LVL 1

Author Comment

by:Oli2
Comment Utility
it works just perfect.
Thanx, bruintje.
Madshi: thanx also for your comment. I'll take a look at xxxScrollInfo also.

Greetings, Oli
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now