Array selected = Array.CreateInstance(typeof(Object), (this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).SelectionCount);
(this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).GetSelectedComponents().CopyTo(selected, 0);
_PropertyGrid.SelectedObjects = new object[] {selected};
我试图在PropertyGrid中显示多个对象,我做错了什么?
答案 0 :(得分:1)
我自己找到答案:)
_PropertyGrid.SelectedObjects = (selected as object[]);
完成工作;)