Board index » delphi » TMemo - Scrolling WITHOUT using scroll bars??

TMemo - Scrolling WITHOUT using scroll bars??

G'Day All,

Please put me out of my misery. I would like to scroll down a memo
containing text WITHOUT using the scrollbar functionaluty provided by
the memo component. That is I don't want to display scroll bars on my
memo, but rather would like to respond to a mouse click from another
control say a TImage.

I have tried both the following without success:

Using the ScrollBy method. However if you don't refreh the memo after
calling this method you get a ghosting effect. The refreshing it
places you at the top of the memo and hence no scroll!!

I have also tried to simulate a keydown event by calling that from the
Image box click event like so:

Var
   The_Key : Word;
   The_ShiftState : TShiftState;
begin
  The_Key := VK_DOWN;

  case (Sender as TImage).Tag of
    1: ShowMessage('Up');
    2: begin
            frmDisplay.memInfoKeyDown(frmDisplay.memInfo, The_Key,
                                                      The_ShiftState);
       end;
    3: ShowMessage('PageUp');
    4: ShowMessage('PageDn');
  end;{case}
end;

As you can see I have used the Virtual keycode for down arrow and
although I can see that the keydown event is being triggered, the memo
does not scroll down.

Any ideas?? An alternative approach?? Thanks for the help. If possible
could you mail me direct??
--Donovan

---------------------------------------------------------------------------
"If you're not busy being born then you are busy dying"  - Bob Dylan

E-Mail: infoafr...@dial.pipex.co.za    (Donovan J. Edye)

For the BIGGEST tourist information source on Southern Africa direct your
web browser to:

http://www.infoafrica.co.za
---------------------------------------------------------------------------

 

Re:TMemo - Scrolling WITHOUT using scroll bars??


Donovan J. Edye (infoafr...@dial.pipex.co.za) wrote:>

Quote
> I would like to scroll down a memo containing text WITHOUT
> using the scrollbar functionaluty provided by ...

PostMessage( yourMemo.handle, EM_LINESCROLL, nCols, nLines);

Re:TMemo - Scrolling WITHOUT using scroll bars??


Dans l'article <4qb3j2...@baloo.pipex-sa.net>, infoafr...@dial.pipex.co.za
(Donovan J. Edye) crit :

Quote
>Please put me out of my misery. I would like to scroll down a memo
>containing text WITHOUT using the scrollbar functionaluty provided by
>the memo component. That is I don't want to display scroll bars on my
>memo, but rather would like to respond to a mouse click from another
>control say a TImage.

Just done the same. Use :
MyMemo.Perform(EM_LINESCROLL, 0, MakeLong(1,0)); {Scroll Down 1 line }

MyMemo.Perform(EM_LINESCROLL, 0, MakeLong(-1,0)); {Scroll Up 1 line }

Happy pgming !
OMF

Other Threads