class CGXListBox: public CListBox, public CGXControl

The CGXListBox class implements a list box control which can be used to display and select items from a list. The user can select items in the list box and can change any style attributes with the CGXStyleSheet dialog.

The list of items which are displayed in the list box is determined through the SetChoiceList attribute of the style object.

Style attributes which specify the appearance of the cell are:

  • Current selection text with SetValue.

  • Text color with SetColor.

  • Background color with SetInterior.

  • Cell frame 3d-effect (raised, inset, normal) with SetDraw3dFrame.

  • Borders with SetBorder.

  • Horizontal alignment with SetHorizontalAlignment.

  • Font with SetFont.

  • default id for CGXListBox control is GX_IDS_CTRL_LISTBOX.

You can apply text to cells with

   SetStyleRange(range,
      CGXStyle()
         .SetControl(GX_IDS_CTRL_LISTBOX)
         .SetValue("Item 1")
         .SetChoiceList("Item 1\nItem 2\nItem 3")
      );

#include <gxall.h>

See Also

 CGXGridCore::RegisterControl  CGXStyle::SetControl  CGXStyle

CGXListBox

 Class Members