par , 28/10/2015 à 11h28 (1885 Affichages)
WinDev : Savoir si une combo est ouvert ou fermée
Contexte technique : WinDev 20 et antérieures.
WinDev met à notre disposition un ensemble de propriétés sur les champ de type Combo : Propriétés associées aux combo
Mais il n'existe pas de propriété pour déterminer si un champ combo est ouvert ou fermé. Vous trouverez ci-dessous le code d'une fonction savoir si un champ combo est ouvert ou fermé :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
// Résumé : Connaitre si une combo est ouverte ou fermée
// Syntaxe :
//[ <Résultat> = ] ComboOuverte (<ps_champ> est chaîne)
//
// Paramètres :
// ps_champ (chaîne ANSI) : Nom du champ de type combo
// Valeur de retour :
// Type indéterminé : 0 si combo est fermée - 1 si combo est ouverte
//
// Exemple :
// Si ComboOuverte("Cbx_ListeCliebt") Alors
//
PROCEDURE ComboOuverte(ps_champ est un chaîne)
SI ChampExiste(ps_champ) ALORS
SI {ps_champ,indChamp}..Type = typComboAVS OU {ps_champ,indChamp}..Type = typComboSNS ALORS
RENVOYER (SendMessage(Handle(ps_champ),343 ,0,0))
SINON
ExceptionDéclenche(2,"Le champ '"+ps_champ+"' n'est pas de type combo/liste déroulante")
FIN
SINON
ExceptionDéclenche(1,"Le champ '"+ps_champ+"' n'existe pas")
FIN
RENVOYER Faux |