Board index » cppbuilder » Scrollbars with smart scroll button size

Scrollbars with smart scroll button size

The scollbars of BCB have only buttons with a fixed size.
I want to use scrollbars with a smart button size:
When the window can display n% of all contents, the scroll bar button has n%
of the size of its maximum.

How can I use such scroll bars, and can I use them in components like
TCustomGrid, TTreeView ect. ?

   Egon Schmid

 

Re:Scrollbars with smart scroll button size


Hi,

Maybe I misunderstand what your question, but as far as I know, the
scrollbars in BCB scale nicely the way you want them to. What version of BCB
are you using? Maybe it was different in older versions.

Jeroen

Quote
"Egon Schmid" <sly...@bluewin.de> wrote in message news:3947a90d@dnews...
> The scollbars of BCB have only buttons with a fixed size.
> I want to use scrollbars with a smart button size:
> When the window can display n% of all contents, the scroll bar button has
n%
> of the size of its maximum.

> How can I use such scroll bars, and can I use them in components like
> TCustomGrid, TTreeView ect. ?

>    Egon Schmid

Re:Scrollbars with smart scroll button size


I'm using BCB 4 Professional

  Egon Schmid

Re:Scrollbars with smart scroll button size


In BCB5, scroll bars have a PageSize property.  Set this to say 50 and you
will get a scroll bar using half the width available.  I don't know if this
property is available in BCB4.  If not, try the following code:

SCROLLINFO si;
memset(&si, 0, sizeof(si));
si.cbSize = sizeof(si);
si.fMask = SIF_PAGE;
si.nPage = 50;  // <----- change to desired size
SetScrollInfo(ScrollBar1->Handle, SB_CTL, &si, true);

This is taken from the 'Create a Windows 95 style scroll bar' in the
C++Builder How-To book.  If you have this book then you can look there for
the entire article.

Russell

Other Threads