No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Vous devez être membre et vous identifier pour publier un article.
Les visiteurs peuvent toutefois commenter chaque article par une réponse.

[VB] Boutons radio (cochés ou pas?)

Astuces de l’Infobrol (Développement)Article publié le 09/05/2005 18:57:31


Comment savoir quelle bouton radio est coché sans les tester un par un ?

Deux méthodes possibles:



Utiliser les opérateurs



  1. MsgBox Op_Condition(Op_Condition(0) * 0 - Op_Condition(1) * 1 - Op_Condition(2) * 2 - Op_Condition(3) * 3).Caption

Valable si on connaît à l’avance le nombre de boutons radios.

Créer une fonction



  1. Private Function QuelleCoche(ObjOptionButton As Variant) As Integer
  2. Dim Ctrl As Control
  3. Dim i
  4. For Each Ctrl In ObjOptionButton
  5. If Ctrl = True Then QuelleCoche = i
  6. i = i + 1
  7. Next
  8. End Function
  9. Exemple d'appel
  10. MsgBox QuelleCoche(Option1)


Appel -› Appeler la fonction "Quellecoche" en passant le nom du controle OptionButton
Réception -› Retour d'un entier





Avatar :: Akira Sato Un article de Akira Sato

Source : www.trucsastuces.com


Sélection, tri et recherche d'articles
FILTRER :
TRIER :1er critère : 2e critère :
CHERCHER : Dans les titres Dans le contenu


[Afficher les liens en fonction des critères du formulaire ci-dessus]

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 13/09/2004, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/ast-rf-238.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.