selectionner une ligne lorsque que ma listview n'a qu'un champ, j'y arrive mais pour selectionner toutes la ligne je n'y parviens pas.
Mon code ne récupére que le contenu de la colonne 1, j'ai testé selectedall, ça ne fonctionne pas.
En lisant la doc de ControlListView , mais l 'exemple ne fonctionne pas.
Code : Tout sélectionner
....
$lview = GUICtrlCreateListView("", 20, 278, 601, 250);,$LVS_NOCOLUMNHEADER)
_GUICtrlListView_AddColumn($lview, "Id", 30)
_GUICtrlListView_AddColumn($lview, "Nom", 95)
_GUICtrlListView_AddColumn($lview, "Prénom", 95)
_GUICtrlListView_AddColumn($lview, "Mail", 120)
_GUICtrlListView_AddColumn($lview, "Mobile", 100)
.....
Func DoubleClick($hWnd, $iMsg, $iwParam, $ilParam)
Local $tagNMHDR = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
Local $hWndFrom, $iIDFrom, $iCode, $hWndList
$hWndList = $lview
If Not IsHWnd($lview) Then $hWndList = GUICtrlGetHandle($lview)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndList
Switch $iCode
Case $NM_DBLCLK
$indexLV = ControlListView($Gui_Contacts, "", $hWndList, "GetSelected") ; récupère l'index de la ligne
[color=#BF0000]$itemtxt = ControlListView($Gui_Contacts, "", $hWndList, "GetText", $indexLV,1) ; récupère le texte de la ligne, colonne 1 c'est la que ça bloque[/color]
$LigneSelectionne = $itemtxt ; ^^
Msgbox(0,"",$LigneSelectionne)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>DoubleClick
Merci
Laddy



