Visual C++ and MFC Fundamentals Chapter 18: Progress-Based Controls
When a Microsoft Flat Scroll Bar control has been added to a parent window, it appears
flat, its buttons and its thumb have no borders. This display is controlled by the
Appearance property whose default value is 1 – fsbFlat. With this value, a simple line is
drawn around each button and the central thumb. To add a visual effect, you can change
the Appearance’s value to the 2 – fsbTrack3D value. In this case, when the mouse is
positioned on top of a button or the thumb, the button or the thumb’s borders are raised,
creating a 3-D effect:
If you prefer the classic 3-D look with borders permentently raised on the buttons and the
thumb, set the Appearance to 0 – fsb3D.
By default, a newly added flat scroll control is oriented horizontally on its parent window
and display a left and a right pointing arrow buttons. The direction of this control is set
using the Orientation combo box. The default value is 1 – cc2OrientationHorizontal. If
you want a vertical scroll bar, change the Orientation value to 0 -
cc2OrientationVertical.
Like the regular scroll bar, this flat control displays a button equipped with an arrow at
each end and a thumb in the middle. The user can click or hold a button to scroll in the
desired direction. The flat scroll bar control allows you to decide what arrow button the
user would be allowed to use. This can be controlled using the Arrows property. Because
the user can scroll by default in both directions, this property has a 0 – cc2Both value. If
you do not want the user to scroll left on a horizontal scroll bar or to scroll up on a
vertical scroll bar, you can set the Arrows property to 1 – cc2LeftUp. In the same way,
to prevent the user from scrolling in the right direction for a horizontal scroll bar or from
scrolling in the bottom direction for a vertical scroll bar, set the Arrows property to 2 –
cc2RightDown.
The limiting values of the flat scroll bar are set using the Min field for the lowest value
and the Max field for the highest value. The value must be in the range of a short integer,
from 0 to 32767. The Min value should be set lower than the Max value.