Hi Bill,
In design-time the parent of component is the DesignerHost of
VisualStudio not the Form. Instead VS put all components in that form
(including the form) into a ComponentCollection, so I think you can
enumerate this collection and find that the reference of the Form, in my
mind , there should be only one Form type in the Collection, the is example
Code is like
//put these code in your component
IEnumerator iter = Site.Container.Components.GetEnumerator();
while(iter.MoveNext())
{
MessageBox.Show(iter.Current.GetType().ToString());
}
Please let me know if you still have questions on this issue, Thanks!
Kind regards,
Ying-Shen Yu [MSFT]
Microsoft Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "Bill Foust" <
[email protected]>
| Sender: "Bill Foust" <
[email protected]>
| Subject: Getting Form a DataSet is on in design mode.
| Date: Mon, 18 Aug 2003 12:07:20 -0700
| Lines: 7
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNlu/LCKXmKMYrqSLuIckgi5gsBPQ==
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:50478
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| I want to get the TEXT value of the FORM that contains a
| DataSet component. Unlike Controls, the Component base
| class does not have a Parent member or any other property
| that points to the form containing the component. Am I
| just missing something?
|
| Bill
|