KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Strikethrough in Listbox Row
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: December 13, 2021

Even though the strikethrough opton is not available with the LISTBOX SET ROW FONT STYLE command or the listbox property list, we can still insert a strikethrough for a listbox row using multi style and the command ST SET ATTRIBUTES.

First, turn on Multi-style for the listbox column.


Then get the text for the listbox row, use ST SET ATTRIBUTES to apply the strikethrough, and then assign the text back into the row.

The example image shows a button that applies a strikethrough to the current selected item.


For an array based listbox, the code behind the button looks like:

ST SET ATTRIBUTES(arrayValues{arrayValues};ST Start text;ST End text;Attribute strikethrough style;1)


For a collection based listbox, the code behind the button looks like:
$target:=Form.current.property //Current selected item
ST SET ATTRIBUTES($target;ST Start text;ST End text;Attribute strikethrough style;1)
Form.current.property:=$target
Form.col:=Form.col