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

Class Property

Hello,

I have two classes defined as follows:

Public Class Parent
...
Public Class Child
...
End Class
End Class

Parent class has 10 properties which will be used in Child class.

Is it possible to make those properties accessible from child class?

Or do I need to create properties in child class and then "pass" the
values of the Parent properties to child?

Thanks,

Miguel

Mar 30 '07 #1
2 1128
Miguel,
To answer your question, lets take 2 approaches
1. Trying to access the parent's properties in the child class : YES...its
possible...if and only if your property is static. But sadly this would
defeat the whole idea of trying to keep the property in a class in the first
place.

2. Accessing the parent by passing it as a variable : Yes...i think its the
only way to do. I generally pass the properties via an overloaded constructor
in the child class.

HTH
--
Sashidhar Kokku
ikaSystems Corp
"shapper" wrote:
Hello,

I have two classes defined as follows:

Public Class Parent
...
Public Class Child
...
End Class
End Class

Parent class has 10 properties which will be used in Child class.

Is it possible to make those properties accessible from child class?

Or do I need to create properties in child class and then "pass" the
values of the Parent properties to child?

Thanks,

Miguel

Mar 30 '07 #2
there is no special relationship other than namespace/scoping with a
child class. for a child instance to access properties of Parent, it
will need a reference (variable) that references an instance of Parent.

-- bruce (sqlwork.com)

shapper wrote:
Hello,

I have two classes defined as follows:

Public Class Parent
...
Public Class Child
...
End Class
End Class

Parent class has 10 properties which will be used in Child class.

Is it possible to make those properties accessible from child class?

Or do I need to create properties in child class and then "pass" the
values of the Parent properties to child?

Thanks,

Miguel
Mar 30 '07 #3

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

Similar topics

1
by: Michael Albanese | last post by:
I am building an ASP.Net web application that records employee incident data over several screens. I have built custom classes to hold this information as the user enters data. In order to persist...
42
by: WindAndWaves | last post by:
Dear All Can you tell me why you use a class module??? Thank you Nicolaas ---
7
by: Baski | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
4
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. ...
10
by: Chet Cromer | last post by:
I am creating a set of base classes and sub classes to use throughout a program I'm developing. The base class represents a generic "lookup table" from my database that contains lists of things...
6
by: thomasp | last post by:
For those who gave advice on the shortfalls of my first attempt at writing a vb.net class, Thank You. I hope that I was able to apply some of your advice to this larger atempt. At first I didn' t...
3
by: Bmack500 | last post by:
I have a sub, and a class. The sub is like this: Sub dothis() Dim aInfoListX As New infoWrapperClass aInfoListX.params = ReadConfig() Dim sqlCMD As New SqlCommand aInfoListX.sqlCmd = sqlCMD ...
6
by: Erick | last post by:
I've created a class called Procs and a collection class called Processes which uses a hastable object to store the Procs. Now i want to enumerate with the "For each" to extract all the Procs in...
3
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
6
by: JonathanOrlev | last post by:
Hello everyone, I have a newbe question: In Access (2003) VBA, what is the difference between a Module and a Class Module in the VBA development environment? If I remember correctly, new...
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.