all groups > vb.net > may 2004 >
You're in the

vb.net

group:

VB6: Access object properties by name


VB6: Access object properties by name Dave Thorens
5/18/2004 11:31:03 PM
vb.net:
Hi. Is there a way to access the property of an object using a string representation of a property name? For example, if I have a class with a property called MyProperty, rather than doing this

myObject.MyPropert

i need to do something like this

dim prop as strin
prop="MyProperty
MsgBox myObject.Properties(prop

Thank

D
Re: VB6: Access object properties by name Dave Thorens
5/19/2004 8:36:01 AM
Thanks for the replies Mattias and Herfried, thats just the ticket

And apologies to all for the 'offtopic' post

D
Re: VB6: Access object properties by name Mattias Sjögren
5/19/2004 9:26:08 AM
Dave,

CallByName



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Re: VB6: Access object properties by name hirf-spam-me-here NO[at]SPAM gmx.at
5/19/2004 9:45:24 AM
* =?Utf-8?B?RGF2ZSBUaG9yZW5z?= <anonymous@discussions.microsoft.com> scripsit:
[quoted text, click to view]

\\\
Result = CallByName(MyObject, "MyProperty", vbGet)
///

BTW: This is a VB.NET group, the VB6 groups can be found at microsoft.public.vb.*.

--
Herfried K. Wagner [MVP]
AddThis Social Bookmark Button