Page 1 sur 1

[R] Combo Dynamique

Posté : mar. 19 juil. 2016 12:12
par Nicoloquinte
Bonjour , J'ai un problème au niveau des combos :shock: , voyez plutôt
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>

$PrefGUI = GUICreate("Préférences", 666, 614, 185, 136)
$Combo1 = GUICtrlCreateCombo("", 32, 272, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "[USB] Xbox 360|[USB] Xbox One|[USB] Clavier", "[USB] Xbox 360")

$ButtonRefX = GUICtrlCreateCombo( "", 272, 360, 49, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$WS_VSCROLL))
GUISetState(@SW_Show ,$PrefGUI )

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
         Case $Combo1
            IF GUICtrlRead($Combo1) = "[USB] Clavier" Then
               $patate = "A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z||?|?|?|1|2|3|4|5|6|7|8|9|0| "
               GUICtrlSetData($ButtonRefX, $patate)
            ElseIf GUICtrlRead($Combo1) = "[USB] Xbox 360" Then
               $patate = "A|B|X3|?|?|?|?|R1|R2|R3|L1|L2|L3"
               GUICtrlSetData($ButtonRefX, $patate)
            EndIf

      Case $GUI_EVENT_CLOSE
         GUISetState(@SW_HIDE,$PrefGUI)


      Case $GUI_EVENT_CLOSE
         Exit

   EndSwitch
WEnd
Combos.png
:shock:

Ceci me permettrait de rendre la combo 2 dynamique mais , je n'arrive pas a effacer le contenu du combo avant de changer son contenu :?
et du coup , les deux contenus se mélangent :cry: , et j'ai une idée pour attribuer une valeur par défaut aux combos mais pas plus :?:

Merci d'avance :mrgreen:

Re: [..] Combo Dynamique

Posté : mar. 19 juil. 2016 13:36
par LavaPower
Bah avant de rajouter du contenu dans le combo, tu le vide non ?

Re: [..] Combo Dynamique  

Posté : mar. 19 juil. 2016 13:41
par mimione
If the "data" starts with GUIDataSeparatorChar or is an empty string "" the previous list is destroyed.

donc: "|A|B|X3|?|?|?|?|R1|R2|R3|L1|L2|L3" (séparateur en début de chaine).

Re: [..] Combo Dynamique

Posté : mar. 19 juil. 2016 14:40
par Nicoloquinte
Merci beacoup :mrgreen: