Board index » delphi » Non-scrolling scroll box

Non-scrolling scroll box

I need a component like TScrollBox, except that I don't want it to move
its contained controls.  Because the amount of information I need to
display is massive (it's a hex file viewer), I intend to paint just the
visible area myself, based on the position and range of the scroll bars.

Doing it with a plain form and scroll bar controls isn't desirable for
several reasons:

 - I'd have to manage hiding and showing the scroll bars.
 - I'd have to figure out how to display the size grip.
 - The scroll bar components don't have the variable-size thumb.

Using TScrollBox by itself doesn't work because it has no OnPaint event.  
It doesn't event fire an event when the scroll bars are manipulated by
the user.  Putting a TPaintBox in it doesn't work because the TPaintBox
moves and resizes when the TScrollBox's range changes.

Using a RichText control would take too much memory.

What I really need is something like a "virtual memo" control, but
something simpler would suffice.  It needs to:

 - Allow setting the range of the scroll bars.
 - Allow painting in the client area.
 - Fire scroll bar events.
 - Hide and show the scroll bars automatically, based on their position
and range.

Any suggestions?

--

    ...Gary

 

Re:Non-scrolling scroll box


Gary:

If you are only viewing the file, TListBox with Style set to one of the
lbOwnerDraw types would probably be ideal.

--
Regards
Ralph (TeamB)

Quote
Gary Weinfurther wrote in message ...
>I need a component like TScrollBox, except that I don't want it to move
>its contained controls.  Because the amount of information I need to
>display is massive (it's a hex file viewer), I intend to paint just the
>visible area myself, based on the position and range of the scroll bars.

<deletia>

Re:Non-scrolling scroll box


In article <6bgtj9$ab...@forums.borland.com>,
rfriedman@spammenot_ibm.spammenot_net says...

Quote
> If you are only viewing the file, TListBox with Style set to one of the
> lbOwnerDraw types would probably be ideal.

Not really, because it still requires Items to be filled in order to
determine the number of rows.  Even if each Item was set to a placeholder
such as an empty string, it could still be many items for a multi-
megabyte file.

--

    ...Gary

Other Threads