[quoted text, click to view] Suraj Guptha wrote:
> I have created a CustomControl that inherits from Textbox
> When i drag and drop my custom control on to a UserControl/ form i want to
> read the UserControl's property / form's property at Design Time
> Ex : When i drag and Drop my Custom Control, i want the constructor of my
> control to read my parent usercontrol's name property or any other property
> and do some operation based on it
>
> I already tried this.Parent but it returns a null value and throws an error.
> Anyhelp with this would be of great use to me
I'm not sure if there is a way to do what you want, but you might try
not accessing the Parent in the constructor. It's possible that at the
time your constructor is called, your custom control has not been added
to the parent's controls collection.
If your custom control inherits from Control, you might try the
TopLevelControl property.
Chris