Listbox : more programming possibilities!

Want to do generic programming using listboxes? So this feature is for you!

With 4D v16 R2, 20+ new listbox properties can be dynamically manipulated by code so 4D Developers now have the full control over the listbox form object! Among a long list: multi-style, wordwrap, single-click edit, truncation mode, column min & max width and much more. The properties apply to the entire list box, its columns, or both.

No more property available only in Design Mode through the Property List: every single property can now be set and get using 2 commands: LISTBOX SET PROPERTY and LISTBOX Get property.

This feature is very useful for generic programming of forms and components. Let’s take an example: when a list box is empty (no columns nor data) and you create columns dynamically using the 4D Language (LISTBOX Insert column, LISTBOX Duplicate column) or SQL statements (Select * from… into “Listbox”), you want to define the settings for each column according to their content type. It is now possible for you to define every single property for each column, as if you were in design mode!

The below example database demonstrates how the new LISTBOX SET PROPERTY and LISTBOX Get property commands work with all these new properties (over 20) plus a couple of “old” ones that can now be set too (and not only get) using these powerful commands:

Example Database

lb_setmultistyle lb_setexpression

For more details, please refer to the language reference manual.

Roland Lannuzel
• Product Owner & 4D Expert •After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.