Listing Non-Visual Component Names at Runtime

  • Thread starter Thread starter d-barton
  • Start date Start date
D

d-barton

Hi,

I have a number of non-visual components which I am trying to get the
name of at run time.

I have managed to reference each component using the following:

Dim pf As Type

pf = f.GetType
Dim fi As FieldInfo = pf.GetField("components",
BindingFlags.Instance Or BindingFlags.NonPublic)
' Dim o As Object =
Dim cl As IContainer = CType(fi.GetValue(f), IContainer)
Dim cm As Component

For Each cm In cl.Components
... etc

The cm.name gives me the type name of the object whereas I need the
actual name that the uer entered.

Am I going about this the correct way, is it possible to get this
info?

Thanks in advance
 
Did you find an answer to your question? I too need the Component name at
runtime and I don't see it with reflection. Please help.

Thanks!
 
Back
Top