Solved

EM_LINESCROLL

Posted on 1999-01-22
7
1,801 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 
LVL 1

Author Comment

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

Accepted Solution

by:
bruintje earned 150 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 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