Shiny Language Reference

Language Reference > User Interface > Scrollbars


setscrollbarbuttonheight

setscrollbarbuttonheight(int ID, int Height);


 

Sets the height of the scrollbar buttons

The SETSCROLLBARBUTTONHEIGHT statement sets the height of the scrollbar up and down buttons within the parent control. This statement is mainly intended for use with custom draw controls, however it can also be used to alter the default scrollbar appearance of a standard scrollbar.

Both buttons are always set to the same height to keep the scrollbar symmetrical. Also, scrollbar buttons are always set to the same width as the scrollbar itself. If you wish to create effects where the buttons do not fill the scrollbar width, use a custom draw control with per-pixel transparent PNG images.

 

Parameters

ID

The control ID of the parent control you wish to resize the scrollbar buttons in

Height

The height of the scrollbar buttons in pixels

 

Return Value

None

 

Example Code

// Create the list box X: 10, Y:10 and sized 200*120
int iListBoxID = createlistbox(1, 10, 10, 200, 120);


// Add 25 test items
for(int iTest = 0; iTest < 25; iTest++)
    addlistboxitem(iListBoxID, "Test item " + iTest);


// Set the text to start at 30 pixels in from the left and
// one pixel down from the top, with a maximum width of
// 150 pixels and height of 100 pixels
setlistboxtextrect(iListBoxID, 30, 1, 150, 100);


// Set the scrollbar to be 20 pixels wide, 120 pixels high
setscrollbarsize(iListBoxID, 20, 120)

// Make the buttons symmetrical, set the height to the
// scrollbar width
setscrollbarbuttonheight(iListBoxID, 20);