首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

关于PropertyGrid困扰小弟我的有关问题

2012-01-15 
关于PropertyGrid困扰我的问题PropertyGrid内属性有:MyIdMyName现在光标已经处在MyName上,如何通过程序让M

关于PropertyGrid困扰我的问题
PropertyGrid内属性有:
MyId
MyName
现在光标已经处在MyName上,
如何通过程序让MyName上的值为 "abcde "?


[解决办法]
楼主试一下用如下的方法来设置值:

this.propertyGrid1.SelectedGridItem.PropertyDescriptor.SetValue(this.propertyGrid1.SelectedObject, "aaaaa ");

System.Console.WriteLine(this.propertyGrid1.SelectedGridItem.Value);

热点排行