Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

EM_LINESCROLL

Posted on 1999-01-22
7
Medium Priority
?
1,933 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

722 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