想要弄个Visual Studio右侧属性栏那样显示效果,有两列,左侧内容不能改,右侧对应的内容更改,请问用什么控件实现呢?

解决方案 »

  1.   

    PropertyGrid类:
    System.Windows.Forms 命名空间下的。
      

  2.   

    使用起来很简单,主要你的对象实现了属性,就会被它读取显示出来,并且可以编辑。
    只要设置它的SelectedObject 就可以,下面的示例就可以让属性编辑器显示文本框的属性。PropertyGrid propertyGrid1 = new PropertyGrid();
       propertyGrid1.CommandsVisibleIfAvailable = true;
       propertyGrid1.Location = new Point(10, 20);
       propertyGrid1.Size = new System.Drawing.Size(400, 300);
       propertyGrid1.TabIndex = 1;
       propertyGrid1.Text = "Property Grid";   this.Controls.Add(propertyGrid1);   propertyGrid1.SelectedObject = textBox1;
      

  3.   

    PropertyGrid
    http://msdn.microsoft.com/zh-cn/library/system.windows.forms.propertygrid(VS.80).aspx