I don't know if there's a better way, but I do it like this:
\\\
using System.ComponentModel;
using System.Windows.Forms;
using System.ComponentModel.Design;
public class MyComponent : Component
private Form owner;
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Form Owner
{
get{return owner;}
set{owner = value;}
}
public override ISite Site
{
get{return base.Site;}
set
{
base.Site = value;
IDesignerHost host = (IDesignerHost)
this.GetService(typeof(IDesignerHost));
if (host != null)
if (host.RootComponent is Form)
owner = (Form)host.RootComponent;
}
}
}
///
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Actualy I should clarify what I would really like is something like
>
> myComponent.Owner=this
>
> Inside a form. Setting my Property with the form.
>