1.将Property Grid 控件添加到工具箱中
由于默认情况下Property Grid 控件没有显示在工具箱中所以需要手动添加。
图1 将Property Grid添加到工具箱(在工具箱上右键选择添加/移除项)
图2 在自定义工具箱对话框中选中PropertyGrid控件
2.编写自定义类,并跟PropertyGrid控件进行绑定
using System;
using System.ComponentModel;
namespace PropertyGridDemo
{
[DefaultPropertyAttribute("Name")]
public class Customer
{
private string name;