Function Reference


_GUICtrlListBox_SetItemHeight

Sets the height, in pixels, of items

#include <GuiListBox.au3>
_GUICtrlListBox_SetItemHeight ( $hWnd, $iHeight [, $iIndex = 0] )

Parameters

$hWnd Control ID/Handle to the control
$iHeight Specifies the height, in pixels, of the item
$iIndex [optional] Specifies the 0-based index of the item in the list box.
Use this only if the control has the LBS_OWNERDRAWVARIABLE style otherwise, set it to zero.

Return Value

Success: True.
Failure: False.

Related

_GUICtrlListBox_GetItemHeight

Example

#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $idListBox

    ; Create GUI
    GUICreate("List Box Set Item Height", 400, 296)
    $idListBox = GUICtrlCreateList("", 2, 2, 396, 296)
    GUISetState(@SW_SHOW)

    ; Add strings
    _GUICtrlListBox_BeginUpdate($idListBox)
    For $iI = 1 To 9
        _GUICtrlListBox_AddString($idListBox, StringFormat("%03d : Random string", Random(1, 100, 1)))
    Next
    _GUICtrlListBox_EndUpdate($idListBox)

    ; Show item height
    MsgBox($MB_SYSTEMMODAL, "Information", "Item height: " & _GUICtrlListBox_GetItemHeight($idListBox))

    ; Set item height
    _GUICtrlListBox_SetItemHeight($idListBox, 26)

    ; Show item height
    MsgBox($MB_SYSTEMMODAL, "Information", "Item height: " & _GUICtrlListBox_GetItemHeight($idListBox))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example