0
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中显示多个对象,我做错了什么?在属性网格中显示多个对象
以何种方式是不工作? – 2010-11-14 08:58:06
它不显示属性,它显示它自己的数组。我从VB.NET转换了代码。在VB中它的工作,但在C#中的某个地方是动摇的错误。在VB.NET中,我只是能够做到.SelectedObjects =选中,但在C#中它提供了一个编译器错误,所以我不得不改变.SelectedObjects = new object [] {selected}。它编译但不起作用。 – 2010-11-14 09:06:19