473,378 Members | 1,319 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,378 software developers and data experts.

Property: ReadOnly on public scope while Read-Write on friend or private scope

Hi,

Below is my scenario...

I want to restrict my clients to access one of my class property
in ReadOnly mode. At the same time as an author of the component i
would like to have read-write access on it.

I tried to write 'Public ReadOnly' and 'Private WriteOnly', but
didn't work.

Is there a way other than doing (i) direct variable access or (ii)
through another property/method with a different name?

Thanks,
Saran.

Jul 19 '06 #1
2 2101
Saran wrote:
Hi,

Below is my scenario...

I want to restrict my clients to access one of my class property
in ReadOnly mode. At the same time as an author of the component i
would like to have read-write access on it.

I tried to write 'Public ReadOnly' and 'Private WriteOnly', but
didn't work.

Is there a way other than doing (i) direct variable access or (ii)
through another property/method with a different name?
VB 2002/3: No
VB 2005: Yes:

Public Property Foo() As String
Get

End Get
Private Set(ByVal value As String)

End Set
End Property

Clients will not be able to Set the property.
--
Larry Lard
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Jul 19 '06 #2
Larry... thanks for the info.

Jul 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marina | last post by:
Hi, I have a class that inherits from CollectionBase, and I'm trying to override its Count property. As per the documentation, this property is overridable - so I should be able to do this. So...
0
by: Job Lot | last post by:
How can I make a property change value of another property at design time? I have added HighlightRow property to custom DataGrid control. Now I want to assign this property similar to DataGrid’s...
3
by: Job Lot | last post by:
I have added a ProgressBar control to StatusBar control and created a custom property as below, to show the properties of the ProgressBar in Property Window of StatusBar. <Browsable(True)> _...
8
by: Davíđ Ţórisson | last post by:
Emm, being a newbie to C#, can someone explain to me what is the difference between a constant (as a Class member) and a read only property?? Also I simply cannot grasp the concept of static...
5
by: fred | last post by:
With a Class is there any difference between a readonly property and function besides having to use Get/End Get. Are there any performance/resource advantages for either. Thanks Fred
3
by: WStoreyII | last post by:
I have a Collection Class That I am Creating , In This Collection Class I have a default Property Item. My Problem is this I have about twenty different Criterias that can be used as a value...
3
by: Hugh O | last post by:
Hi, I am creating a class. I do not have any problem defining the property statements except when an array is involved. Would someone be able to show me the correct syntax for a Property...
2
by: Brook | last post by:
In webform.aspx: <cc:ctlB ID="ctl1" runat="server" Width="200px" /> If set value to width property, I will get a error that say ctlB.Page is null. This control will be fine with no width...
4
by: James.R.Thigpen | last post by:
I am trying to create a read-only interface for an object. Say I have a Part, which I want to Implement IReadOnlyPart. IReadOnlyPart will have ReadOnly Property PartNumber() As String And I...
4
by: FullBandwidth | last post by:
I have been perusing various blogs and MSDN pages discussing the use of event properties and the EventHandlerList class. I don't believe there's anything special about the EventHandlerList class in...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.