> What version of Visual Studio are you using? I'm using VS2005, and those
> properties are there.
This isn't being done in Visual Studio. It's taking place at runtime on a
machine where VS isn't installed. I'm manually creating the same design form
seen in VS using "System.ComponentModel.Design.DesignSurface" as my starting
point. I can create my form without issue but don't know how to kill the
sizing grips that automatically appear on each control (nor how to disable
dragging of each control). The "Locked" property seen in VS is some sort of
dynamic (design-time) property which isn't an official member of "Control"
or "Form". I'm not sure how to access this property at runtime assuming it's
even there (maybe it's added behind the scenes). If not then there must be
some other way to pull this off.
John Allen - 21 Feb 2007 12:56 GMT
> This isn't being done in Visual Studio. It's taking place at runtime on a
> machine where VS isn't installed. I'm manually creating the same design
[quoted text clipped - 6 lines]
> runtime assuming it's even there (maybe it's added behind the scenes). If
> not then there must be some other way to pull this off.
Ok, I can do it using reflection like so:
TypeDescriptor.GetProperties(myControl)["Locked"].SetValue(myControl, true);
This seems highly irregular however. Is there a more mainstream way to do it
or is this it. Thanks.