Page 1 sur 1
ListViewGadget multisélection, nouvo probl..
Publié : lun. 22/août/2005 9:34
par lionel_om
Bonjour
Est-ce possible ?
PS : il me semblait avoir déja posé la question, mais je ne retrouve pas le post ...

Publié : mar. 23/août/2005 13:06
par lionel_om
Personne peu m'aider ?
Sur MSDN ya des codes pour VB (listV.multiselect = True), mais je trouve pas de méthode ou de constante...

Publié : mar. 23/août/2005 14:24
par lionel_om
J'ai trouvé ça, mais ça ne marche pas :
Code : Tout sélectionner
val.l = GetWindowLong_(GadgetID(0), #GWL_STYLE)
val = val & #LBS_MULTIPLESEL
SetWindowLong_(GadgetID(0), #GWL_STYLE, val)
J'ai essayé aussi avec cette constante : #LVS_SINGLESEL
Code : Tout sélectionner
val.l = GetWindowLong_(GadgetID(0), #GWL_STYLE)
SetWindowLong_(GadgetID(0), #GWL_STYLE, val & ~#LVS_SINGLESEL)
Mais rien ne marche...
A l'aide !!!

Publié : mar. 23/août/2005 14:32
par Dr. Dri
c'est pas & c'est |
Dri
Publié : mar. 23/août/2005 14:35
par lionel_om
Oops, boulette...
Mais après rectification, ça ne marche toujours pas ...

Publié : mar. 23/août/2005 14:52
par lionel_om
Résolu
L'aid en'ai pas à jour, car elle n'indique pas qu'on peut ajouter un paramètre à ListVG() :
Publié : ven. 02/sept./2005 15:12
par lionel_om
Est-il possibler de changer la propriété d'une listViewGadget en cours d'éxecution (multiselection/single)
J'ai essayé ce code, ms ca ne marche pas... :
Code : Tout sélectionner
Enumeration
#WIN
#LIST
#BT1
#BT2
EndEnumeration
If OpenWindow(#WIN,0,0,320,200,#PB_Window_ScreenCentered | #PB_Window_SystemMenu,"CheckBoxGadget") And CreateGadgetList(WindowID())
ListViewGadget(#LIST, 10, 40,100, 150)
For i = 0 To 10
AddGadgetItem(#LIST, -1, "item 0" + Str(i))
Next i
ButtonGadget(#BT1, 130,120, 80,20, "Single")
ButtonGadget(#BT2, 130,150, 80,20, "Multi")
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadgetID()
Case #BT1
SetWindowLong_(GadgetID(#LIST), #GWL_STYLE, GetWindowLong_(GadgetID(#LIST), #GWL_STYLE) & ~#LBS_EXTENDEDSEL)
;EndCase
Case #BT2
SetWindowLong_(GadgetID(#LIST), #GWL_STYLE, GetWindowLong_(GadgetID(#LIST), #GWL_STYLE) | #LBS_EXTENDEDSEL)
;EndCase
EndSelect
EndIf
Until EventID=#PB_Event_CloseWindow
EndIf