probleme affichage selection MENU DEROULANT

Vous débutez et vous avez besoin d'aide ? N'hésitez pas à poser vos questions
david
Messages : 208
Inscription : jeu. 03/févr./2005 21:10

probleme affichage selection MENU DEROULANT

Message par david »

le prog ci-après fonctionne correctement :

Code : Tout sélectionner

Enumeration
  #StatusBar_0
EndEnumeration 
 
  If OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))

    ComboBoxGadget(#StatusBar_0, 10, 40, 250, 100)
   
  
    For a = 1 To 5 : AddGadgetItem(#StatusBar_0, -1,"liste déroulante " + Str(a)) : Next a
    SetGadgetState(#StatusBar_0, 0)    ; sélectionne le troisième élément (la numérotation commence à 0)
      Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

je voudrais faire pareil sur ce bout de code mais il ne déroule pas
une fois qu'il déroule comment dire si choix=1 faire.....
si quelqu'un me m'aider....

Code : Tout sélectionner

;- Window Constants
;
Enumeration
  #Window_0
  #PB_EventGadget
EndEnumeration

;- Gadget Constants
;
Enumeration
  #ListeRead
  #String_0
  #String_1
  #Personnalise
  #Valide_0
  #Valide_1
EndEnumeration

;- StatusBar Constants
;
Enumeration
  #StatusBar_0
EndEnumeration



  If OpenWindow(#Window_0, 216, 0, 239, 63, "titre",#PB_Window_SystemMenu |#PB_Window_ScreenCentered | #PB_Window_TitleBar)
    If CreateStatusBar(#StatusBar_0, WindowID(#Window_0))
      EndIf

      If CreateGadgetList(WindowID(#Window_0))
     
     
             
        
   
     
        ComboBoxGadget(#ListeRead, 0, 0, 130, 20)
   For a = 1 To 5 : AddGadgetItem(#StatusBar_0, -1,"liste déroulante " + Str(a)) : Next a
    SetGadgetState(#StatusBar_0, 0)    ; sélectionne le troisième élément (la numérotation commence à 0)
    

        StringGadget(#String_0, 130, 0, 70, 20, "")
        StringGadget(#String_1, 130, 20, 70, 20, "00:00:00")
        StringGadget(#Personnalise, 0, 20, 130, 20, "Personnalisé :")
        ButtonGadget(#Valide_0, 200, 0, 40, 20, "OK")
        ButtonGadget(#Valide_1, 200, 20, 40, 20, "OK")
  
   
    
    
    
          EndIf        
        
Repeat 
Event=WaitWindowEvent() 
If Event=#PB_Event_Gadget
If EventType()=#PB_EventType_LeftClick 
Select EventGadget() 
                     
                         Case #Valide_0
                         End
                         Case #Valide_1
                         End
                         
                        
       EndSelect 
    EndIf 
  EndIf 
Until Event=#PB_Event_CloseWindow 
EndIf
Avatar de l’utilisateur
Jacobus
Messages : 1559
Inscription : mar. 06/avr./2004 10:35
Contact :

Message par Jacobus »

Quand tu fais du copier/coller relis ton code après.
Il s'agit d'une faute d'inattention de ta part.

Code : Tout sélectionner

ComboBoxGadget(#ListeRead, 0, 0, 130, 20) 
   For a = 1 To 5 : AddGadgetItem(#StatusBar_0, -1,"liste déroulante " + Str(a)) : Next a 
    SetGadgetState(#StatusBar_0, 0)    ; sélectionne le troisième élément (la numérotation commence à 0)
Tu as créé une combobox nommée #ListeRead et tu veux ajouter un déroulant à la statusbar... ça marchera pas :?

Pour le reste, une suite de conditions (if > elseif > endif) pour tester les chaînes retournées par la combobox te permet d'agir en fonction.
Quand tous les glands seront tombés, les feuilles dispersées, la vigueur retombée... Dans la morne solitude, ancré au coeur de ses racines, c'est de sa force maturité qu'il renaîtra en pleine magnificence...Jacobus.
Répondre