By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

VB.NET Class Properties

P: n/a
Perhaps someone can enlighten me with a peculiar question I have:

Why is that in a Class library written in VB.NET, a public property can be
accessed through "Class.Property" notation when consumed by a VB.NET
application. However, when consuming such Class library from a C# app, the
property must be accessed using "Class.Get_Property" or "Class.Set_Property"
notation. Whereas if I code the Class library in C#, I can access the same
property using Class.Property notation.

May I doing something wrong?

Thanks in advance,
Paul Wu

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Paul,

It works as expected
Either ways it shows property name & NOT set_property & get_property

Could you post your code to demonstrate ?
Also, which ver of VS.net are you using ?

Kalpesh

Nov 21 '05 #2

P: n/a
"Paul Wu" <pa*****@stop.rulemasters.com> schrieb:
Why is that in a Class library written in VB.NET, a public property can be
accessed through "Class.Property" notation when consumed by a VB.NET
application. However, when consuming such Class library from a C# app, the
property must be accessed using "Class.Get_Property" or
"Class.Set_Property" notation. Whereas if I code the Class library in C#,
I can access the same property using Class.Property notation.


Properties can be accessed without specifying 'get_' and 'set_' prefixes in
both, VB.NET and C#. Note that C# is case-sensitive, so you'll have to type
the property's name exactly as it is spelled in the VB.NET class library.
If this doesn't solve the problem, I suggest to post some test code which
doesn't work.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.