KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Getting the pointer and name of the clicked Listbox header
PRODUCT: 4D | VERSION: 16 | PLATFORM: Mac & Win
Published On: October 16, 2017

Listbox header is a clickable numeric object. It is bound or a predefined or dynamic variable. To capture the clicked state and name of the header object, here is a simple way to handle it.

1. Make sure the On Header Click event is enabled for the Listbox.

2. Add the following code to the Listbox object method.

If (Form event=On Header Click)

  C_POINTER($listboxHeader_p)
  C_TEXT($listboxHeaderName_t)

   // Get the pointer to the clicked Listbox header
  $listboxHeader_p:=OBJECT Get pointer(Object current)

   // Get the name of the clicked Listbox header from the object pointer
  $listboxHeaderName_t:=OBJECT Get title($listboxHeader_p->)

End if