3.12.4.3 Show Scroll Bar in List Box

Description

Following code show how to add scrollbar to list box when the list box becomes too long.

Example

#include <GetNbox.h>

void STR_MAX_SHOWN_ITEM_COUNT_ATTRIB_ex()
{
    GETN_BOX( treeTest );
    
    //each list box has 5 items 
    GETN_LISTBOX(LType, "GETN_LISTBOX", 1, "t-Test|Correlation|NLSF|Polynomial Fit|Statistics")
    GETN_MULTISEL_STR_LISTBOX(StateList, _L("GETN_MULTISEL_STR_LISTBOX"), "", "Apple|Orange|Banana|Berries|Grapes")
	GETN_MULTISEL_LISTBOX(list, "GETN_MULTISEL_LISTBOX", 0, "Apple|Orange|Banana|Berries|Grapes")
    
	//only show 3 items
    treeTest.LType.SetAttribute(STR_MAX_SHOWN_ITEM_COUNT_ATTRIB, 3);
    treeTest.StateList.SetAttribute(STR_MAX_SHOWN_ITEM_COUNT_ATTRIB, 3);
    treeTest.list.SetAttribute(STR_MAX_SHOWN_ITEM_COUNT_ATTRIB, 3);
    
    if( GetNBox( treeTest ))
        out_tree( treeTest );
}