public void InitializeDesignSurface(Type rootControlType) { if (_surface == null) { _mainView = new TestForm(); #if NET_2_0 _surface = new DesignSurface(); _surface.BeginLoad(rootControlType); _mainView.Controls.Add((Control)_surface.View); #else _surface = new Mono.Design.Test.DesignerHost(); Control rootControl = (Control)Activator.CreateInstance(rootControlType, BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.Instance, null, null, null); _surface.Add(rootControl, null); _mainView.Controls.Add(rootControl); #endif _mainView.Controls[0].Visible = true; _mainView.Show(); } }