Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What interface question
Message
De
26/08/2006 10:47:32
 
 
À
25/08/2006 17:10:07
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Divers
Thread ID:
01148728
Message ID:
01148814
Vues:
15
Brian,

You also might want to try the IContainerControl interface in addition to IContainer. Between the two of them, it will probably cover all container controls.

~~Bonnie



>Im trying to write a sub that will go through a form and collect a referance to all the controls of a given type (IControlDataAction).(code below) I was hoping to make a recursve call to go through any containers with a controls cdollection tab pages and so on. I have not been able to find an interface that would work for this. any suggestions?
>
>
>Private Sub RegisterCmdbtns(ByVal objControl As ContainerControl)
> Dim intControlIndex As Int16
> If objControl.Controls.Count() < 1 Then
> Exit Sub
> End If
> For intControlIndex = 0 To objControl.Controls.Count() - 1
> Debug.WriteLine(objControl.Controls(intControlIndex).Name)
> If TypeOf objControl.Controls(intControlIndex) Is System.ComponentModel.IContainer Then
> RegisterCmdbtns(objControl.Controls(intControlIndex))
> End If
> If TypeOf objControl.Controls(intControlIndex) Is IControlDataAction Then
> RegisterDataActionControl(objControl.Controls(intControlIndex))
> End If
> Next
> End Sub
>
>
>Thanks
>Brian Grant
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform