Friend Property Set and Public Property Get

  • Thread starter Thread starter solex
  • Start date Start date
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
 
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.
 
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.
 
I'm still waiting for the newsgroup microsoft.public.notepad !!!



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

****************************************
 
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?
 
Back
Top