Afficher des infos bulles

Fermé
Pop85 Messages postés 16 Date d'inscription jeudi 25 août 2022 Statut Membre Dernière intervention 15 décembre 2022 - 14 nov. 2022 à 11:22
 Pop85 - 15 nov. 2022 à 18:35

Bonjour à tous,

Sous Visual Basic Express j'écris un programme sur la numérologie, le Feng-Shui et différentes astrologies. Est-il possible d'afficher des info-bulles pour expliquer différents résultats. Par exemple lorsque mon curseur se stop sur une "TextBox" affichant un résultat, un message s'affiche explique brièvement à quoi le résultat correspond. Idem sur un Button, etc...

D'avance merci et bonne semaine à tous.

Pop85

1 réponse

cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728
14 nov. 2022 à 11:54

Bonjour,

Intéresses-toi à la propriété ToolTip de ton control

Voir ceci


2
Pop85 Messages postés 16 Date d'inscription jeudi 25 août 2022 Statut Membre Dernière intervention 15 décembre 2022
15 nov. 2022 à 15:18

Bonjour, je me suis intéressé aux propriétés de ce contrôle, voici que j'ai écrit mais l'info bulle ne s'affiche pas.

Private Sub ToolTip1_Popup(sender As Object, e As PopupEventArgs) Handles ToolTip1.Popup
        ToolTip1.ShowAlways = True
        ToolTip1.SetToolTip(BTN1Elan, "Elan Spirituel")
    End Sub 

Peux tu m'aider, Merci

Pop85

0
cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728 > Pop85 Messages postés 16 Date d'inscription jeudi 25 août 2022 Statut Membre Dernière intervention 15 décembre 2022
15 nov. 2022 à 15:32

Dans le lien donné, il y a un exemple. Il suffit de l'adapter!

' This example assumes that the Form_Load event handling method
' is connected to the Load event of the form.
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
   ' Create the ToolTip and associate with the Form container.
   Dim toolTip1 As New ToolTip()
   
   ' Set up the delays for the ToolTip.
   toolTip1.AutoPopDelay = 5000
   toolTip1.InitialDelay = 1000
   toolTip1.ReshowDelay = 500
   ' Force the ToolTip text to be displayed whether or not the form is active.
   toolTip1.ShowAlways = True
   
   ' Set up the ToolTip text for the Button and Checkbox.
   toolTip1.SetToolTip(Me.button1, "My button1")
   toolTip1.SetToolTip(Me.checkBox1, "My checkBox1")
End Sub

Voilà

@+

1
Pop85 > cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024
15 nov. 2022 à 18:35

Super sympa, ça fonctionne.

Merci beaucoup.

0