Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Global $Form1 = GUICreate("Form1", 346, 406, 192, 124)
Global $hListView = GUICtrlCreateListView("", 16, 16, 314, 342)
Global $Label1 = GUICtrlCreateLabel("Ré-apparition du ListView" & @CRLF & " dans 3 secondes", 60, 120, 351, 50)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
Global $Button2 = GUICtrlCreateButton("Boutton Caché", 128, 168, 91, 25)
Global $Button1 = GUICtrlCreateButton("Valider", 144, 368, 75, 25)
GUISetState(@SW_SHOW)
; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetStyle($hListView, $LVS_REPORT)
GUICtrlSetState($hListView, $GUI_HIDE)
Sleep(3000)
GUICtrlSetState($hListView, $GUI_SHOW)
EndSwitch
WEnd