Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

pb d appel de fonction

1 réponse
Avatar
fabrizio-r
Bonjour a tous,

Voila j ai une fonction de la forme suivante :


Private Sub vbalExplorerBarCtl3_ItemClick(itm As=20
vbalExplorerBarLib6.cExplorerBarItem)
=20
' Bouton "Ajouter une nouvelle t=E2che"
=20
If itm.Key =3D "NEWTASK" Then
If itm.Text =3D "Ajouter une nouvelle t=E2che" Then
Adodc1.Recordset.AddNew
.........



ensuite j ai une auttre fonction o=F9 je souhaite appeler=20
la fonction precedente dc je fai ceci :

Private Sub cmdbar_ButtonClick(Index As Integer, btn As=20
vbalCmdBar6.cButton)

If btn.Key =3D "EDITTASK" Then
vbalExplorerBarCtl3_ItemClick ("NEWTASK")

.......

et ca ne fonctionne pas....


si quelqu un peut m aider.....

Merci d avance

Fabrice.

=20

1 réponse

Avatar
ng
Salut,

Regarde bien le type, le paramètres doit être un objet cExplorerBarItem :

Call vbalExplorerBarCtl3_ItemClick(Btn)

Mais d'une manière générale, il n'est pas recommandé d'appeler des procédure
d'événement, il est préférable de créer une autre procédure qui sera appelée
par l'événement et par ton autre code.

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



fabrizio-r a écrit :

Bonjour a tous,

Voila j ai une fonction de la forme suivante :


Private Sub vbalExplorerBarCtl3_ItemClick(itm As
vbalExplorerBarLib6.cExplorerBarItem)

' Bouton "Ajouter une nouvelle tâche"

If itm.Key = "NEWTASK" Then
If itm.Text = "Ajouter une nouvelle tâche" Then
Adodc1.Recordset.AddNew
.........



ensuite j ai une auttre fonction où je souhaite appeler
la fonction precedente dc je fai ceci :

Private Sub cmdbar_ButtonClick(Index As Integer, btn As
vbalCmdBar6.cButton)

If btn.Key = "EDITTASK" Then
vbalExplorerBarCtl3_ItemClick ("NEWTASK")

.......

et ca ne fonctionne pas....


si quelqu un peut m aider.....

Merci d avance

Fabrice.