Bonjour,
J'utilise un fichier *.ini pour alimenter mes ComboBox en cascade.
Pour alimenter ma 1ère ComboBox, j'utilise le nom des sections trouvées.
Et pour alimenter ma deuxième ComboBox, j'utilise les Clefs et les valeurs en fonction de la précedentes...
Mais mon problème et que pour la première lecture c'est OK, mais quand je fais un autre choix dans ma première ComboBox, ma deuxième ComboBox ne s'actualise pas et garde toujours les anciennes valeurs, alors que si j'utilise ConsoleWrite, se sont les bonnes valeurs...
J'ai beau faire un GUICtrlSetData($c_Station, ""), ça ne fait rien.
Merci par avance
Ci joint mon code:
► Afficher le texte
Code : Tout sélectionner
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$IniFilePath = @ScriptDir & "\ini\cells.ini"
Global $c_Ligne
Global $c_Station
Opt("GUIOnEventMode", 1)
$hGUI = GUICreate("", 184, 96, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Quitter", $hGUI)
GUISetState(@SW_SHOW)
_LoadSection()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _Quitter()
Exit
EndFunc
Func _LoadSection()
$c_Ligne = GUICtrlCreateCombo("", 0, 0, 145, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL))
$ArrayOfReadSectionNames = IniReadSectionNames($IniFilePath)
For $i = 1 To $ArrayOfReadSectionNames[0]
GUICtrlSetData($c_Ligne, $ArrayOfReadSectionNames[$i])
Next
GUICtrlSetOnEvent($c_Ligne, "_LoadStation")
EndFunc
Func _LoadStation()
$VarProduction = GUICtrlRead($c_Ligne)
$ReadSection = IniReadSection($IniFilePath, $VarProduction)
$c_Station = GUICtrlCreateCombo("", 0, 60, 145, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL))
GUICtrlSetData($c_Station, "")
For $j = 1 To $ReadSection[0][0]
GUICtrlSetData($c_Station, $ReadSection[$j][0] & "_" & $ReadSection[$j][1], $ReadSection[0][0])
Next
EndFunc