Help Center

CListBox.SetItemHeightmethod

Sets the height, in pixels, of items in a list box.

WindowsmethodCListBox.incdocumented

Syntax

FUNCTION SetItemHeight (BYVAL hListBox AS HWND, BYVAL nHeight AS DWORD) AS LONG

Parameters

NameDescription
hListBoxThe handle of the listbox control.
indexSpecifies the zero-based index of the item in the list box. Use this parameter only if the list box has the LBS_OWNERDRAWVARIABLE style; otherwise, set it to zero.
nHeightSpecifies the height, in pixels, of the item. The maximum height is 255 pixels.

Return value

If the index or height is invalid, the return value is LB_ERR.

Description

Sets the height, in pixels, of items in a list box. If the list box has the LBS_OWNERDRAWVARIABLE style, this message sets the height of the item specified by the wParam parameter. Otherwise, this message sets the height of all items in the list box.

Example

CListBox.SetItemHeight(hListBox, 30)

Reference

  • Include file CListBox.inc
  • Defined in AfxNova/CListBox.inc:502
  • Documented in Windows/WIndows Controls/CListBox Class.md
  • Topic: CListBox Class