Parent form from a component

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?
LVL 71
Éric MoreauSenior .Net ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arvindb1Commented:
In your component you can say me.Parentform

or in the form where you are hosting it say

ControlName.ParentForm
0
AzmodanCommented:
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
Éric MoreauSenior .Net ConsultantAuthor Commented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Éric MoreauSenior .Net ConsultantAuthor Commented:
Anyone has this in VB.Net?
0
Éric MoreauSenior .Net ConsultantAuthor Commented:
I have found my answer (while I was not searching for it): http://www.code-magazine.com/Article.aspx?quickid=0401091
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.