Expand|Select|Wrap|Line Numbers
- Private Sub ApplySecurity (pCtl as Control)
- ‘… apply security based on what’s the control’s tag …
- If pCtl.HasChildren Then
- For Each ctl as Control In pCtl.Controls
- ApplySecurity(ctl)
- Next
- End If
- End Sub
Controls like the tabcontrol and toolstrip access their children via an Items collection. So checking pCtl.HasChildren on a toolstrip comes up false.
How can I go about checking if controls like these have children without having to use a CType(pCtl,toolstrip).DropDown.Items.Count > 0 ???
Is there a specific interface that these controls are built on so I can CType it and test via a Children/Items property?