Listing Non-Visual Component Names at Runtime

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
 
C

Craig

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top