前些天,由于在项目中需要用到PropertyGrid这个控件,展现其所在控件的某些属性,由于有些控件的属性较多,不易浏览,而且PropertyGrid的排序默认的按照字母的顺序排列的,这样导致在在某些属性想要排在第一位非常不方便,于是我总结了网友们的一些思路,自己便解决呢!现在来说说解决思路:

     1.首先为PropertyGrid添加SelectedObjectsChanged事件!      

1  private void propertyGrid_flow_SelectedObjectsChanged(object sender, EventArgs e)
2         {
3             propertyGrid_flow.Tag = propertyGrid_flow.PropertySort;
4             propertyGrid_flow.PropertySort = PropertySort.CategorizedAlphabetical;
5             propertyGrid_flow.Paint += new PaintEventHandler(propertyGrid_flow_Paint);      
6         }
View Code

相关文章:

  • 2021-12-09
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2021-10-30
  • 2021-09-29
相关资源
相似解决方案