Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

EM_LINESCROLL

Posted on 1999-01-22
7
Medium Priority
?
1,990 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
ID: 1362809
Adjusted points to 100
0
 
LVL 1

Author Comment

by:Oli2
ID: 1362810
Edited text of question
0
 
LVL 1

Author Comment

by:Oli2
ID: 1362811
Edited text of question
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:Oli2
ID: 1362812
Adjusted points to 150
0
 
LVL 44

Accepted Solution

by:
bruintje earned 600 total points
ID: 1362813
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
ID: 1362814
Or look at GetScrollInfo/SetScrollInfo...

Regards, Madshi.
0
 
LVL 1

Author Comment

by:Oli2
ID: 1362815
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

876 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