Hi Robby,
You need to get the IDesignerHost of the designer Window, get its
System.ComponentModel.Design.IComponentChange service.
The following article of mine shows how to retrieve services from the
IDesignerHost:
HOWTO: Manipulating controls of Windows forms from Visual Studio .NET
add-ins
http://support.microsoft.com/default.aspx?scid=kb;en-us;555170
Then you need to trap the ComponentAdded event of IConmponentChangeService,
but since the event is fired before the control is completely sited,
altering properties at that moment is pointless since they will be
overwritten, so you need to use the ComponentChanged event with the
"Controls" property in those cases. The consequence is that it is very
tricky and it takes quite time to make it work correctly in all cases. If
you want this info to build your own add-in it is fine, but if you need it
for your own use, my add-in (below) has a Control Default Properties feature
that would meet your needs.

Signature
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
>I have looked in the events automation sample and cant seem to find any
> example of how to monitor for when a new control is created to then set
> some
> default properties. Any help or direction appreciated...
>
> Cheers, Robby
Robby White - 22 Apr 2005 06:57 GMT
I would very much like an example of this tricky code as I am developing an
add-in for code and control templates. My control templates are deep as they
can drill down into collections, add objects and set properties, however I
want the ability to set default control templates also.
I used to use your tools for VB6 and have browsed the .NET ones also.
So tell me do you single handedly create and maintain all things
extensibility!
Cheers, Robby
> Hi Robby,
>
[quoted text clipped - 24 lines]
> >
> > Cheers, Robby
Carlos J. Quintero [.NET MVP] - 22 Apr 2005 10:08 GMT
>I would very much like an example of this tricky code as I am developing an
> add-in for code and control templates.
I can´t provide the code directly but I can assist you with the problems
that you encounter. So, start getting the IComponentChangeService interface,
trapping its events and setting new default properties as explained in the
article.
> I used to use your tools for VB6 and have browsed the .NET ones also.
> So tell me do you single handedly create and maintain all things
> extensibility!
Yes, I have spent my last years since 2000 dealing with extensibility of MS
tools, and answering questions about them. If you have not visited it yet, I
recommend you to join (free) the yahoo forum
http://groups.yahoo.com/group/vsnetaddin/, the best one of the web, which is
more specific for .NET add-ins. You have also lots of resources on my web
site.

Signature
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com