You are a expert, thank you, but if this code is in moulde sub, for example:
Public sub AAA(Byval FormName as Form)
For Each comp As System.ComponentModel.Component In
FormName.components.Components
' Tooltip and ContextMenuStrip will be found here
Next
End Sub
The code above will not work if replace "Me" with "FormName", why?
Thank you
"kimiraikkonen" <
[email protected]>
??????:f2c9053a-4fc0-4ac3-b23e-f09df16cd...@g17g2000prg.googlegroups.com....
I think because they don't inherit Control class, as a result they're
not identified as controls.
See which classes/interfaces they implement. For example ToolTip class
inherits Component class, not control:
http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip....
So, you can loop Components to get them as follows:
For Each comp As System.ComponentModel.Component _
In Me.components.Components
' Tooltip and ContextMenuStrip will be found here
Next
Hope this helps,
Onur Güzel