Il faudrait peut être rajouter en Gras dans la notice que EventType() ne supporte pas le Gadget ComboBox non ?
Voici un exemple qui m'a torturé toute la matiné !
Code : Tout sélectionner
Enumeration
#Combo
#StringGadget
EndEnumeration
If OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ComboBoxGadget(#Combo, 10, 10, 250, 100, #PB_ComboBox_Editable)
AddGadgetItem(#Combo, -1, "Liste déroulante éditable...")
StringGadget(#StringGadget, 10, 40, 250, 100,"")
For a = 1 To 5 : AddGadgetItem(#Combo, -1,"Elément de liste déroulante " + Str(a)) : Next a
SetGadgetState(1, 2) ; sélectionne le troisième élément (la numérotation commence à 0)
Repeat
Event=WaitWindowEvent()
If Event=#PB_Event_Gadget
Select EventGadget()
Case #Combo
If EventType()=#PB_EventType_LostFocus
Debug"LostFocus Combo"
EndIf
Case #StringGadget
If EventType()=#PB_EventType_LostFocus
Debug"LostFocus StringGadget"
EndIf
EndSelect
EndIf
Until Event=#PB_Event_CloseWindow
EndIf