Actually throwing exception is documented in MSDN as the way of preventing
component from changing.
http://msdn2.microsoft.com/en-us/library/system.componentmodel.design.icomponent
changeservice.oncomponentchanging.aspx
As far as it goes for freazing the control so it cannot be moved or hiding
the resizing handlers I believe this is possible to be achieved by the
Behavior Service. I haven't done it myself, but as a starting point I'll
suggest read through the following MSDN article:
http://msdn2.microsoft.com/en-us/library/ms171820.aspx
Here also links to information regarding classes participating in the
designtime behavior feature:
BehaviorService class
http://msdn2.microsoft.com/en-us/library/system.windows.forms.design.behavior.be
haviorservice.aspx
Behavior class
http://msdn2.microsoft.com/en-us/library/system.windows.forms.design.behavior.be
havior.aspx
Glyph class
http://msdn2.microsoft.com/en-us/library/system.windows.forms.design.behavior.gl
yph.aspx
Adorner class
http://msdn2.microsoft.com/en-us/library/system.windows.forms.design.behavior.ad
orner.aspx

Signature
HTH
Stoitcho Goutsev (100)
>> This event is supressed during loading/unloadin the control since
>> obviously the whole internal state of the event is changed, thus it
[quoted text clipped - 15 lines]
> a month investigating things. At least I now have a fallback method just
> in case however. Thanks again for your help (greatly appreciated).
Rob Peterson - 24 Jan 2007 15:57 GMT
> Actually throwing exception is documented in MSDN as the way of preventing
> component from changing.
> http://msdn2.microsoft.com/en-us/library/system.componentmodel.design.icomponent
changeservice.oncomponentchanging.aspx
Thanks very much. The link I was looking at was for the event since that's
what I'm hooking. Unlike the method in the above link, it makes no mention
of the exception. See here:
http://msdn2.microsoft.com/en-us/library/system.componentmodel.design.icomponent
changeservice.componentchanging(VS.80).aspx
> As far as it goes for freazing the control so it cannot be moved or hiding
> the resizing handlers I believe this is possible to be achieved by the
[quoted text clipped - 12 lines]
> Adorner class
> http://msdn2.microsoft.com/en-us/library/system.windows.forms.design.behavior.ad
orner.aspx
I'll take a look at this. I'm very new to this area but I know that .NET 2.0
introduced the "DesignSurface" class which is what I'm working with (not a
custom designer per se). I'm still working on a conceptual understanding of
the issues however so it will take some time to get my head wrapped things.
Thanks again though.