Up to this point, we have been using tabs to display the hierarchy. In this example, we will use a bitmap rather than tabs to indicate the list box level.  The end result, with the list box fully populated, displays as shown below:

Since the expansion and collapse of the list box occurs automatically when an item is double clicked, there is not need for the Expand All or the Collapse All buttons that we needed in the tab programming example.  In this example, we use the SORT bitmap, which has 3 bitmaps, which display as shown below:

The first bitmap is an up arrow, the second the down arrow, and the third is blank.

Set the list box to use the SORT bitmap, and set the number of images to 3, as shown below:

To get this effect, simply populate the list box from the Populate button.  Substitute the following in the CLICK event of B_POPULATE:

case ctrlName = 'B_POPULATE'
   content = ''
   content<1> = '2-1:OpenInsight'
   content<2> = '2-2:Tech Notes'
   content<3> = '3-3:Hierarchical List Boxes Part 1'
   content<4> = '3-3:Hierarchical List Boxes Part 2'
   content<5> = '2-2:White Papers'
   content<6> = '3-3:How to Get to the Web With OpenInsight'
   Set_Property(WinId: '.LB_H', 'LIST', content)
   Send_Message(WinId: '.LB_H', 'EXPAND', 0, 1)

 

 

  • No labels