Add an icon to listbox header

From 4D v15 R5, you can add an icon in the listbox header by programming. The image can come from a file, a picture variable or the picture library. This icon can be placed on the left or on the right side of the column.

Since you can replace the icon programmatically, you can display your own customized order arrows, an icon based on of the displayed content, or using SVG, even dynamically created images, such as the number of unread emails.


We have adapted the two following commands:

  • OBJECT Get format ( { * ;} object )
  • OBJECT SET FORMAT ( { * ;} object ; displayFormat )

To format a list box header, in the “displayFormat” parameter, pass a character string respecting the following syntax “picture;iconPos” where:

  • picture: Picture linked to a header that comes from a picture library or a picture variable:If the picture comes from a picture library, enter its number, preceded by a question mark (e.g.: “?250”).If the picture comes from a picture variable, enter the variable name.If the picture comes from a file stored in the Resources folder of the database, enter a URL of the type “#{folder/}picturename” or “file:{folder/}picturename”.
  • iconPos: position of the icon. Two values are possible: iconPos = 1 meaning Left or iconPos = 2 meaning Right

Example Database

For more details, please take a look at the 4D v15 R5 upgrade manual.

Caroline Briaud
• 4D Product Team Leader •Caroline joined 4D SAS in July, 2013 as an Engineering Manager responsible for new features definition. Caroline helped the Engineering team to put in place the R-release concept, with the new development process definition and its application within 4D’s engineering teams.Caroline is now leading the 4D Product team, mainly made up of Product Owners which are representing the customers within Engineering.Caroline started her career as a software developer in the mobile phone industry. She specialized in program management with an American company in an international context spread across US, India and China.