Friend Property Set and Public Property Get

S

solex

Is it possible to have two different access modifiers on a property? I
used to be able to do this in VB6 but I cannot find the right syntax for
..NET.

Thanks,
Dan
 
A

Armin Zingler

solex said:
Is it possible to have two different access modifiers on a property?
I used to be able to do this in VB6 but I cannot find the right
syntax for
.NET.

Unfortunately this is not possible. Use a Public Readonly proeperty Get and
a Friend Sub SetTheProperty.
 
H

Herfried K. Wagner [MVP]

Hello,

solex said:
Is it possible to have two different access modifiers on a property? I
used to be able to do this in VB6 but I cannot find the right syntax for
.NET.

That's not possible in VB.NET. You can create procedures ('Get'x and
'Set'x) with different modifiers instead.
 
T

TJoker .NET [MVP]

I'm still waiting for the newsgroup microsoft.public.notepad !!!



--
TJoker, MCSD.NET
MVP: Paint, Notepad, Solitaire

****************************************
 
R

Robert Jacobson

Just out of curiosity, does anyone know why this isn't allowed in .Net? (I
assume this is a limitation of the CLR, not a language-specific limitation.)
It was such a nice feature in VB6.

Is it a violation of some OO principle -- that the get and set accessors
must have the same scope?
 

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