开发者

Display multiple objects in property grid

开发者 https://www.devze.com 2023-01-25 04:33 出处:网络
Array selected = Array.CreateInstance(typeof(Object), (this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).SelectionCount);
Array selected = Array.CreateInstance(typeof(Object), (this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).SelectionCount);
(this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).GetSel开发者_StackOverflowectedComponents().CopyTo(selected, 0);
_PropertyGrid.SelectedObjects = new object[] {selected};

I am trying to display multiple objects in the PropertyGrid, what am I doing wrong?


Found my answer myself :)

_PropertyGrid.SelectedObjects = (selected as object[]);

does the job ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消