Function Reference


_GUICtrlListView_GetView

Retrieves the current view of the control

#include <GuiListView.au3>
_GUICtrlListView_GetView($hWnd)

Parameters

$hWnd Control ID/Handle to the control

Return Value

Success: The current view:
0 - Details
1 - Large Icon
2 - List
3 - Small Icon
4 - Tile
Failure: -1

Remarks

Minimum OS - Windows XP.

Related

_GUICtrlListView_SetView, _GUICtrlListView_GetViewDetails, _GUICtrlListView_GetViewLarge, _GUICtrlListView_GetViewList, _GUICtrlListView_GetViewSmall, _GUICtrlListView_GetViewTile

Example


#include <GUIConstantsEx.au3>
#include <GuiListView.au3>

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hListView

    GUICreate("ListView Get View", 400, 300)
    $hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState()

    ; Add columns
    _GUICtrlListView_AddColumn($hListView, "Items", 100)

    ; Add items
    _GUICtrlListView_BeginUpdate($hListView)
    For $iI = 1 To 10
        _GUICtrlListView_AddItem($hListView, "Item " & $iI)
    Next
    _GUICtrlListView_EndUpdate($hListView)

    ; Set view
    MsgBox(4160, "Information", "View: " & _GUICtrlListView_GetView($hListView))
    _GUICtrlListView_SetView($hListView, 4)
    MsgBox(4160, "Information", "View: " & _GUICtrlListView_GetView($hListView))

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