Aide pour affichage valeur d'une combo box dans boite dialogue.

cs_mtibo Messages postés 2 Date d'inscription samedi 18 janvier 2003 Statut Membre Dernière intervention 21 juillet 2007 - 21 juil. 2007 à 08:53
cs_mtibo Messages postés 2 Date d'inscription samedi 18 janvier 2003 Statut Membre Dernière intervention 21 juillet 2007 - 21 juil. 2007 à 14:00
Bonjour,

Je suis sur un mini projet a titre perso et j'aurai besoin d'une petite aide.
Je travaille avec Autoplay media studio 6 et je souhaiterai afficher le résultat de la colone item data dans une boite de dialogue.
" j'ai reussi grace avec l'aide du logiciel a afficher la valeur data (item_data) mais cela ne change pas selon le choix que je prend.
Je m'explique par exemple ma combobox est un listing d'ampoule et j'aimerai que lorsque je fais un choix cela m'affiche son prix ou une valeur.

-- Check to see if any errors occurred calling the ComboBox.AddItem action.
-- If any error occurred, display the error message.
error = Application.GetLastError();
if (error ~= 0) then
   Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end


 


-- Gets the item data of the first item in the combobox object.
item_data = ComboBox.GetItemData("ComboBox1", 1);


 


-- If the item has item data, display its contents, otherwise notify that there was none.
if (item_data ~= "") then
   Dialog.Message ("Résultat", "Sur ce produit il y a  "..item_data, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
   Dialog.Message ("Item Data", "There is no item data at index 1.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

Merci par avance je repasserai dans l'apres midi si vous avez besoin de plus d'info n'hesitez pas

2 réponses

cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
21 juil. 2007 à 09:08
Salut,

Est comme cela :

Evènement click de ton comboBox
Dim MySelection As string
       MySelection = Combo1.Text

MsgBox "Information relative à votre choix: " & MySelection, VbInformation Or VbOkOnly,"Information utilisateur" 

OU

MsgBox "Information relative à votre choix: " & Combo1.Text, VbInformation Or VbOkOnly,"Information utilisateur" 

A+
Exploreur

 Linux a un noyau, Windows un pépin

 
0
cs_mtibo Messages postés 2 Date d'inscription samedi 18 janvier 2003 Statut Membre Dernière intervention 21 juillet 2007
21 juil. 2007 à 14:00
merci je vais voir ce que je peux faire.
0
Rejoignez-nous