[ TUVGM ] - Comment reconnaitre un contrôle qui possède un index ?
3 réponses
The Ultimate Video Game Museum
Tout est dans la question ... ^_^
Comment reconnaitre un contrôle qui possède un index ?
J'ai essayé de faire ça avec la ligne "If Control_Cible.Index" met ça génère
une erreur lorsque le contrôle ciblé ne possède pas d'index car je suppose
que la propriété n'existe pas.
For Each Control_Cible In Feuille.Controls
If Control_Cible.Index <> Null Then ...
[...]
Next Control_Cible
Merci d'avance pour l'aide apportée car là je suis complètement bloqué.
Cordialement,
Topper
Webmastering, webdesign des sites :
The Ultimate Video Game Museum : http://www.TUVGM.com/
TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/
FreeDO France : http://www.TUVGM.com/freedo/
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
fredg
> Comment reconnaitre un contrôle qui possède un index ?
salut, voici une solution.
Private Sub Command4_Click() Dim CC As Object
On Error GoTo Command4_Click_Error
For Each CC In Me.Controls Debug.Print CC.Name & " " & CC.Index Next
On Error GoTo 0 Exit Sub
Command4_Click_Error: If Not Err.Number = 343 Then MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Command4_Click of Feuille Form1" End If End Sub
Fred
> Comment reconnaitre un contrôle qui possède un index ?
salut,
voici une solution.
Private Sub Command4_Click()
Dim CC As Object
On Error GoTo Command4_Click_Error
For Each CC In Me.Controls
Debug.Print CC.Name & " " & CC.Index
Next
On Error GoTo 0
Exit Sub
Command4_Click_Error:
If Not Err.Number = 343 Then
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
Command4_Click of Feuille Form1"
End If
End Sub
> Comment reconnaitre un contrôle qui possède un index ?
salut, voici une solution.
Private Sub Command4_Click() Dim CC As Object
On Error GoTo Command4_Click_Error
For Each CC In Me.Controls Debug.Print CC.Name & " " & CC.Index Next
On Error GoTo 0 Exit Sub
Command4_Click_Error: If Not Err.Number = 343 Then MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Command4_Click of Feuille Form1" End If End Sub
Fred
The Ultimate Video Game Museum
J'ai modifié mon programme pour ne plus avoir cette erreur. Je garde ça de coté au cas où je retombe dessus.
Merci pour la réponse.
Cordialement,
Topper
Webmastering, webdesign des sites : The Ultimate Video Game Museum : http://www.TUVGM.com/ TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/ FreeDO France : http://www.TUVGM.com/freedo/
"fredg" a écrit dans le message de news:
> Comment reconnaitre un contrôle qui possède un index ? salut, voici une solution.
Private Sub Command4_Click() Dim CC As Object
On Error GoTo Command4_Click_Error
For Each CC In Me.Controls Debug.Print CC.Name & " " & CC.Index Next
On Error GoTo 0 Exit Sub
Command4_Click_Error: If Not Err.Number = 343 Then MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure
Command4_Click of Feuille Form1" End If End Sub
Fred
J'ai modifié mon programme pour ne plus avoir cette erreur.
Je garde ça de coté au cas où je retombe dessus.
Merci pour la réponse.
Cordialement,
Topper
Webmastering, webdesign des sites :
The Ultimate Video Game Museum : http://www.TUVGM.com/
TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/
FreeDO France : http://www.TUVGM.com/freedo/
"fredg" <fredg@lycos.com> a écrit dans le message de
news:ux33hDHfDHA.1832@TK2MSFTNGP09.phx.gbl...
> Comment reconnaitre un contrôle qui possède un index ?
salut,
voici une solution.
Private Sub Command4_Click()
Dim CC As Object
On Error GoTo Command4_Click_Error
For Each CC In Me.Controls
Debug.Print CC.Name & " " & CC.Index
Next
On Error GoTo 0
Exit Sub
Command4_Click_Error:
If Not Err.Number = 343 Then
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
J'ai modifié mon programme pour ne plus avoir cette erreur. Je garde ça de coté au cas où je retombe dessus.
Merci pour la réponse.
Cordialement,
Topper
Webmastering, webdesign des sites : The Ultimate Video Game Museum : http://www.TUVGM.com/ TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/ FreeDO France : http://www.TUVGM.com/freedo/
"fredg" a écrit dans le message de news:
> Comment reconnaitre un contrôle qui possède un index ? salut, voici une solution.
Private Sub Command4_Click() Dim CC As Object
On Error GoTo Command4_Click_Error
For Each CC In Me.Controls Debug.Print CC.Name & " " & CC.Index Next
On Error GoTo 0 Exit Sub
Command4_Click_Error: If Not Err.Number = 343 Then MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure
Command4_Click of Feuille Form1" End If End Sub
Fred
The Ultimate Video Game Museum
OK !!! ^_^
Topper
Webmastering, webdesign des sites : The Ultimate Video Game Museum : http://www.TUVGM.com/ TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/ FreeDO France : http://www.TUVGM.com/freedo/
"fredg" a écrit dans le message de news:
petite rectif... dans la gestion d'exeption, il faut placer un resume next pour l'erreur
343,
sinon tout s'arrete.. Fred "The Ultimate Video Game Museum" wrote in message news:3f675bd9$0$20158$ > J'ai modifié mon programme pour ne plus avoir cette erreur. > Je garde ça de coté au cas où je retombe dessus. > > Merci pour la réponse. > > Cordialement, > > Topper > > Webmastering, webdesign des sites : > The Ultimate Video Game Museum : http://www.TUVGM.com/ > TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/ > FreeDO France : http://www.TUVGM.com/freedo/ > > > "fredg" a écrit dans le message de > news: > > > Comment reconnaitre un contrôle qui possède un index ? > > salut, > > voici une solution. > > > > Private Sub Command4_Click() > > Dim CC As Object > > > > On Error GoTo Command4_Click_Error > > > > For Each CC In Me.Controls > > Debug.Print CC.Name & " " & CC.Index > > Next > > > > On Error GoTo 0 > > Exit Sub > > > > Command4_Click_Error: > > If Not Err.Number = 343 Then > > MsgBox "Error " & Err.Number & " (" & Err.Description & ") in > procedure > > Command4_Click of Feuille Form1" > > End If > > End Sub > > > > Fred > > > > > >
OK !!! ^_^
Topper
Webmastering, webdesign des sites :
The Ultimate Video Game Museum : http://www.TUVGM.com/
TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/
FreeDO France : http://www.TUVGM.com/freedo/
"fredg" <fredg@lycos.com> a écrit dans le message de
news:O15CGgOfDHA.3464@TK2MSFTNGP11.phx.gbl...
petite rectif...
dans la gestion d'exeption, il faut placer un resume next pour l'erreur
343,
sinon tout s'arrete..
Fred
"The Ultimate Video Game Museum" <tuvgm@online.fr> wrote in message
news:3f675bd9$0$20158$626a54ce@news.free.fr...
> J'ai modifié mon programme pour ne plus avoir cette erreur.
> Je garde ça de coté au cas où je retombe dessus.
>
> Merci pour la réponse.
>
> Cordialement,
>
> Topper
>
> Webmastering, webdesign des sites :
> The Ultimate Video Game Museum : http://www.TUVGM.com/
> TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/
> FreeDO France : http://www.TUVGM.com/freedo/
>
>
> "fredg" <fredg@lycos.com> a écrit dans le message de
> news:ux33hDHfDHA.1832@TK2MSFTNGP09.phx.gbl...
> > > Comment reconnaitre un contrôle qui possède un index ?
> > salut,
> > voici une solution.
> >
> > Private Sub Command4_Click()
> > Dim CC As Object
> >
> > On Error GoTo Command4_Click_Error
> >
> > For Each CC In Me.Controls
> > Debug.Print CC.Name & " " & CC.Index
> > Next
> >
> > On Error GoTo 0
> > Exit Sub
> >
> > Command4_Click_Error:
> > If Not Err.Number = 343 Then
> > MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
> procedure
> > Command4_Click of Feuille Form1"
> > End If
> > End Sub
> >
> > Fred
> >
> >
>
>
Webmastering, webdesign des sites : The Ultimate Video Game Museum : http://www.TUVGM.com/ TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/ FreeDO France : http://www.TUVGM.com/freedo/
"fredg" a écrit dans le message de news:
petite rectif... dans la gestion d'exeption, il faut placer un resume next pour l'erreur
343,
sinon tout s'arrete.. Fred "The Ultimate Video Game Museum" wrote in message news:3f675bd9$0$20158$ > J'ai modifié mon programme pour ne plus avoir cette erreur. > Je garde ça de coté au cas où je retombe dessus. > > Merci pour la réponse. > > Cordialement, > > Topper > > Webmastering, webdesign des sites : > The Ultimate Video Game Museum : http://www.TUVGM.com/ > TUVGM Live Playing ! : http://www.TUVGM.com/liveplaying/ > FreeDO France : http://www.TUVGM.com/freedo/ > > > "fredg" a écrit dans le message de > news: > > > Comment reconnaitre un contrôle qui possède un index ? > > salut, > > voici une solution. > > > > Private Sub Command4_Click() > > Dim CC As Object > > > > On Error GoTo Command4_Click_Error > > > > For Each CC In Me.Controls > > Debug.Print CC.Name & " " & CC.Index > > Next > > > > On Error GoTo 0 > > Exit Sub > > > > Command4_Click_Error: > > If Not Err.Number = 343 Then > > MsgBox "Error " & Err.Number & " (" & Err.Description & ") in > procedure > > Command4_Click of Feuille Form1" > > End If > > End Sub > > > > Fred > > > > > >