erriyadimounir
Messages postés34Date d'inscriptionvendredi 1 décembre 2000StatutMembreDernière intervention 1 juin 2009
-
23 juin 2008 à 12:28
erriyadimounir
Messages postés34Date d'inscriptionvendredi 1 décembre 2000StatutMembreDernière intervention 1 juin 2009
-
23 juin 2008 à 13:29
Bonjour,
salut à tous,c'est mounir du maroc,je veux quand le composant "shape" change son couleur (à travers un timer) un bip sonore indique le changement du couleur,c'est possible ça ? merci de m'aider
Merci d'avance
mortalino
Messages postés6786Date d'inscriptionvendredi 16 décembre 2005StatutMembreDernière intervention21 décembre 201118 23 juin 2008 à 12:37
salut,
exemple simple :
Option Explicit
Public oColor As OLE_COLOR
Private Sub Form_Click()
Shape1.FillColor = &HFF&
End Sub
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
oColor = Shape1.FillColor
End Sub
Private Sub Timer1_Timer()
If oColor <> Shape1.FillColor Then
oColor = Shape1.FillColor
Beep
End If
End Sub
~
<small>Mortalino ~ [code.aspx?ID=39466 Colorisation
automatique]</small>
erriyadimounir
Messages postés34Date d'inscriptionvendredi 1 décembre 2000StatutMembreDernière intervention 1 juin 2009 23 juin 2008 à 13:29
bonjour,
Mille merci Mortalino pour ton aide,ça marche bien ,j'ai testé seulement la couleur de "shape" et j'ai mis Beep,
Merci d'avance
Cordialement
voilà un autre code : ça marche à 100%
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_ASYNC = &H1 'ASYNC permet de jouer sous interruption
Const SND_NODEFAULT = &H2 'NODEFAULT évitera un message d'erreur si le fichier wav manque
Const SND_SYNC = &H0 'SYNC plays fera jouer jusqu'au bout le morceau
Const SND_MEMORY = &H4 'MEMORY jouer le fichier mis en mémoire
Private Sub Timer1_Timer()
If Shape1.FillColor = &HFF& Then
sndPlaySound App.Path & "\Avertir.wav", SND_ASYNC Or SND_NODEFAULT
End If