I want to make a hierarchical list box, but can't find the control in form designer. Where is it?

In the form designer you have a section of tools you can choose from to add object to your form. One of them is a list box. You have to select this one and make a change to it. After you have this on the form, double click on it and make sure the 'Hierarchical listbox' checkbox is checked.

Now that my listbox is on my form, and I have selected the appropriate check-box, now what do I do?

This all depends on what you want to do. Do you want to put in data from a table? Do you want to put in hard coded data? According to how you answer this question will determine your course of action.

Can I add images to my listbox or do I have to keep it as straight text?

You can add images very easily in your listbox. Here's how: 1) Double-click on your listbox in design mode to get the properties. Select the desired bitmap image and make sure you specify the amount of images it has. 2) When you decide your method of filling the list box with data, you can then decide which bitmap image, <1>, <2>, <3>, etc…will go where.

Is it possible to expand or collapse all the branches in the list box at once?

Yes, this is done very easy using the EXPAND message with Send_Message(). Here is an example and the syntax:

**This is the syntax of the EXPAND property using Send_Message.
listItem = Send_Message(controlId, "EXPAND", position, level)
**This is an example:.
listItem = Send_Message(@WINDOW : ".HIER_VIEW" , "EXPAND", 0, 0)

Can I delete or insert items in the listbox programmatically?

Yes, you need to use the INSERT_EX and DELETE_EX messages. The following are examples of the syntax:

**This is the syntax of the INSERT_EX.

InsertedPosition = Send_Message(@WINDOW : ".HIER_VIEW" , "INSERT_EX" , indexEx, insertText)

**This is the syntax of the DELETE_EX.

DeletedItem = Send_Message(@WINDOW : ".HIER_VIEW" , "DELETE_EX" , indexEx)

Can OpenInsight automatically populate the listbox for me?

Yes and No. Yes it can when connecting to it through a Notes database. No when you are dealing with Linear Hash and ODBC. This can be easier and in a lot of cases better to do yourself, this way you can decide how the data will look, which images to use on specific branches, etc.

After I have all my data in there, now what? Is it just there for viewing? Can I interact with the information in the listbox?

In order to interact with almost every object it must have events. In this case, the Hierarchical Listbox has events for you to interact with. Again, this is going to be up to you on how your interaction will take place.

  • No labels