473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Friend Property Set and Public Property Get

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
6 8828
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
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MstrControl | last post by:
Greetings All... I'm creating a BaseClass that will connect to a database and retrieve the all the properties values from it. So far so good. All the inherited classes retrieve it values from...
2
by: Colin Fine | last post by:
Now that PHP5 has proper scoping for class properties and methods, I've been looking in vain for friend classes, or wondering if there's another way to achieve this effect: class A { ...
5
by: | last post by:
hello there, what is the difference between Shared and Protected Shared? where can I read more about theses kind of variables (or whatever they are....sorry, don't know the word in eng.) ...
17
by: Tom | last post by:
I have written a property, where I want to have the GET be available to anyone (i.e. Public); however, I want the SET to be available ONLY to the class or program itself (i.e. Friend). In VB6...
1
by: Chad | last post by:
Hey everyone, Ok, I am very security consious with my application(s). I am currently working on an application in which I want to create several "global" variables available ONLY to my...
4
by: Boni | last post by:
Dear all, I would like to have an access from one class to the private variables of other. But I also can't find a right sintax. The word "friend" seems to do something else, VB compiler still...
0
by: AndyB | last post by:
I'm using xsd.exe to generate a typed-dataset. Then using typed dataset tables (datatables containing two columns--a name and a value) to bind to ASP.NET dropdown list controls (for the dropdown...
3
by: jbeteta | last post by:
Hello, I have a problem declaring variables. I need to create an object oRpte as ReportClass on WebForm1.aspx and be able to use its value on WebForm2.aspx. For declaring the property oRpte()...
5
by: Jameson | last post by:
Hi, I have a property defined something like: Public Property Index As Integer Get Return m_Index End Get
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.