C# propertygrid控件有什么用,怎么用
谁知道winform中的propertygrid控件有什么作用,应该怎么用,最好有个例子,加分...
谁知道winform中的propertygrid控件有什么作用,应该怎么用,最好有个例子,加分
展开
展开全部
运行时动态改变实例的属性值。例子给你。
public enum Gender
{
male, female
}
public class People
{
string name;
public string Name
{
get { return name; }
set { name = value; }
}
int age;
public int Age
{
get { return age; }
set { age = value; }
}
Gender gender;
public Gender Gender_
{
get { return gender; }
set { gender = value; }
}
}
public Form1()
{
InitializeComponent();
People p1 = new People();
this.propertyGrid1.SelectedObject = p1;
}
public enum Gender
{
male, female
}
public class People
{
string name;
public string Name
{
get { return name; }
set { name = value; }
}
int age;
public int Age
{
get { return age; }
set { age = value; }
}
Gender gender;
public Gender Gender_
{
get { return gender; }
set { gender = value; }
}
}
public Form1()
{
InitializeComponent();
People p1 = new People();
this.propertyGrid1.SelectedObject = p1;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询