Solved

Parent form from a component

Posted on 2003-12-08
7
938 Views
Last Modified: 2010-05-18
When you design a new component in VB.Net, how can the component know by itself (without having to feed a property) on which form the component is hosted?
0
Comment
Question by:Éric Moreau
  • 4
7 Comments
 
LVL 5

Expert Comment

by:arvindb1
ID: 9902259
In your component you can say me.Parentform

or in the form where you are hosting it say

ControlName.ParentForm
0
 

Expert Comment

by:Azmodan
ID: 9902598
A component that inherits from the Control class, has the Parent property that refers to the container.
A component must inherit Control if you want to use Controls.Add method.
0
 
LVL 70

Author Comment

by:Éric Moreau
ID: 9993479
I didn't had time to return to this project. Sorry.

My component inherits from System.ComponentModel.Component and is to be hosted into the component tray (at the same place a timer component is hosted). How can I know the form that is hosting this component?

ParentForm is not existing for components.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 70

Author Comment

by:Éric Moreau
ID: 9993993
0
 
LVL 70

Author Comment

by:Éric Moreau
ID: 9993994
Anyone has this in VB.Net?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 0 total points
ID: 10200302
I have found my answer (while I was not searching for it): http://www.code-magazine.com/Article.aspx?quickid=0401091
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question