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

Is it Possible to get parent/container objects of other objects?

If an object is the child of another object, is it possible to refer to
the parent's properties? Put simply (in pseudocode),

Public Class MyChild_Class
Public NameOfChild as string
End Class

Public Class MyParent_Class
Public NameOfParent As String
Public Child as MyChild_Class
End Class

dim a as MyParent_Class
a.NameOfParent="Dad"
a.NameOfChild="Billy"

Console.WriteLine(a.Child.PARENTOBJECTBASE.NameOfP arent)

Ideally, I'd like something for PARENTOBJECTBASE that can refer to
whatever class is the "containing parent class" for my child object. I
suppose I'm looking for something similiar to MyBase (which only works
with classes that are *inherited*, which my class is *not*).

I'm trying *not* to have to include the parent info in each child if at
all possible, hence my quest for this method. Is it possible?
Nov 21 '05 #1
2 1853
Sam,

Except when it is a Top form class, in other cases you can just pass a
reference from the parent class in the contructor, and than all is done.
(With a topform you can set the parentform property).

I hope this helps?

Cor
Nov 21 '05 #2
Cor Ligthert wrote:
Sam,

Except when it is a Top form class, in other cases you can just pass a
reference from the parent class in the contructor, and than all is done.
(With a topform you can set the parentform property).

Cor,
The classes I'm attempting to use are not forms, merely class objects.
However, I do think that what you mention may be my solution, though.
Sending a reference to the child object is something that never occurred
to me. I will try this, thanks!
Nov 21 '05 #3

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

Similar topics

1
by: Tim Conkling | last post by:
I've run into a problem with a game I'm designing -- I (think) I need to do something ugly, for speed reasons, and I'm wondering if people here might have any ideas about how solve my problem more...
6
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the...
3
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
6
by: Mary Kerrigan | last post by:
I have a user control (menu) with a data list: <asp:DataList id="MyList" runat="server"> <ItemTemplate> <asp:hyperlink cssclass="MenuUnselected" id="myLink1" Text='<%#...
1
by: Adam Knight | last post by:
Hi all, I am really trying to find a solution to this problem. I have a pair of nested data lists. I want to retrieve a current value out of the parent lists DataItem object...
7
by: Paul | last post by:
Hello, I'm coming from a PHP background and am working on a large-scale VB.NET project. One of the cornerstones of this project is a reusable form class, to standardize our web forms. My goal...
5
by: gnewsgroup | last post by:
In my user control, I would like to find a Label control in the parent page (the page that uses my user control). I need to update that Label.Text when something happens in the user control. I...
1
by: =?Utf-8?B?VW1lc2huYXRo?= | last post by:
Hi, I have a XML file which contains some Container and item information. Both the tag identying by the same tag (Container). But the outer is parent one and all other are child to that parent. ...
7
by: SjaakBanaan | last post by:
Hey guys (m/f), I've got a problem that's been having me pulling out hairs and losing sleep quite some time now. The thing is this. I have a container form with a subform control. This control...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.