Hi Wally
Herfried suggestion to use System.Reflexion works
perfectly. I've been using the following procedure to
browse all menus/contextMenus of a form.
Public Sub BrowseMenus(ByVal f As Form)
Dim myForm As Type = f.GetType()
Dim fields As FieldInfo() = myForm.GetFields
(BindingFlags.Instance Or BindingFlags.NonPublic)
For Each field As FieldInfo In fields
If field.FieldType.Name = "ContextMenu" Then
Dim menu As ContextMenu = DirectCast
(field.GetValue(f), ContextMenu)
<code here>
End If
If field.FieldType.Name = "MainMenu" Then
Dim menu As MainMenu = DirectCast
(field.GetValue(f), MainMenu)
<code here>
End If
Next
End Sub
Kind Regards
Jorge
-----Original Message-----
With this cycle
For each ctl in Controls
.....
Next
I can see all visual components on a form but I cannot
see Menus,ContextMenus, ToolTips, Timers, ecc.
How could I write a cycle to see these components.
Thanks.
W
.