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

Friend Property Set and Public Property Get

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
This is gone in .Net, I also miss it.

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

****************************************
"solex" <so***@nowhere.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #2

P: n/a
"solex" <so***@nowhere.com> schrieb
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.
--
Armin

Nov 20 '05 #3

P: n/a
Hello,

"solex" <so***@nowhere.com> schrieb:
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.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

P: n/a
Thanks everyone for your response.

TJoker nice MVP qualifications

"TJoker .NET [MVP]" <no****@nonono.no> wrote in message
news:Oc**************@TK2MSFTNGP11.phx.gbl...
This is gone in .Net, I also miss it.

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

****************************************
"solex" <so***@nowhere.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
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


Nov 20 '05 #5

P: n/a
I'm still waiting for the newsgroup microsoft.public.notepad !!!

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

****************************************
"solex" <so***@nowhere.com> wrote in message
news:uY**************@TK2MSFTNGP09.phx.gbl...
Thanks everyone for your response.

TJoker nice MVP qualifications

"TJoker .NET [MVP]" <no****@nonono.no> wrote in message
news:Oc**************@TK2MSFTNGP11.phx.gbl...
This is gone in .Net, I also miss it.

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

****************************************
"solex" <so***@nowhere.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
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



Nov 20 '05 #6

P: n/a
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?
"solex" <so***@nowhere.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.