Solved

Parent form from a component

Posted on 2003-12-08
7
939 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

751 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