C# – WinForms – Enable DesignMode

cdesignmodewinformswpf

For a OSS project, I'm trying to add controls programmatically to a WinForms view.. and I want to make these editable and resizeable as in the Visual Studio Designer. I've been playing around with adding programmatically, using Controls.Add(label).. but I'm struggling to work out how to make the UI editable.

I'm assuming it would make use of DesignMode – but I can only find getters and not setters for these properties. Simply put – is there any way of enabling and disabling DesignMode in WinForms programmatically?

I'm yet to investigate WPF – perhaps that would be able to have editable controls?

Many thanks, sorry to be a pain right after christmas..
T

Best Answer

Actually there is a way to make UI editable as in VS designer.You have to host the winforms designer on your form. this info might help: http://msdn.microsoft.com/en-us/magazine/cc163634.aspx

Related Topic