Read name of variable during runtime

P

Peter Gast

Hi,
I need as parameter for a control the names of my properties as a string.
How can I get the name of the property as a string during runtime

Example:
Private _MyVar As Double
Public ReadOnly Property MyVar As Double
Get
Return _MyVar
End Get
End Property


MsgBox ( ???? MyVar.GetType ?????)

The result should be "MyVar", I've got a tip to us Type.GetField(...), but
this expressions doesn't work.


Thanks Peter
 

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