Re: Re; Get the parent assembly

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: mageos (mageos_at_spammers.have.big.zits)
Date: 11/16/04


Date: Tue, 16 Nov 2004 17:31:39 GMT

Another possibility is to get the Windows form that is hosting your control.

System.Windows.Forms.Form parentForm = FindForm();

if ( parentForm != null )
{
     System.Type classType = parentForm.GetType();
     System.Assembly classAssembly = classType.Assembly;
}

Hope that helps

Matt Osborne

Steven Cheng[MSFT] wrote:
> Hi Darren,
>
> In addition to Richard's suggestion on the "GetEntryAssembly" ,you may also
> try the "GetCallingAssembly" which may also help. And seems currently we
> only have the two means to get the upper stream assembly.
> If the parent assembly is the main assembly of that applcation, then the
> GetEntryAssembly can do it well.
> Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



Relevant Pages

  • Re: "Global" objects
    ... I named the form class frmMain in the MainForm.vb file (i.e. ... I am talking about user controls and ... Dim parentForm As frmMain = CType, ... control which is called before the control is ultimately assigned to ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: cascading combos and sub forms
    ... I am continuing to try and get the correct control source code. ... that holds the subform and the name of the form that's being used as a ... Let's assume you've got a form ParentForm and a form SubForm. ...
    (microsoft.public.access.forms)
  • RE: Unable to Close the From
    ... "John Paul. ... > there during the duration of removing the actual control in question. ... Form parentForm = item.FindForm; ... >> My form is not closing. ...
    (microsoft.public.dotnet.framework)
  • Accessing Internet Explorer document from contained vb Activex
    ... Can someone tell me how to access the Internet Explorer ... Me.parent, parentform, findform don't seem to work. ... P. Vogel ...
    (microsoft.public.dotnet.faqs)
  • Accessing Internet Explorer document from contained vb Activex
    ... Can someone tell me how to access the Internet Explorer ... Me.parent, parentform, findform don't seem to work. ... P. Vogel ...
    (microsoft.public.dotnet.languages.vb.controls)