General information
Category:
Coding, syntax and commands
Title:
What interface question
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only