用枚举做
enum TitleEnum
{
myTitle1=0,
myTitle2,
myTitle3
}
private TitleEnum title = TitleEnum.myTitle1;
public TitleEnum Title
{
get { return title; }
set {title = value; Invalidate(); }
}
后面的函数我用了一个switch(this.title)
case TitleEnum title .myTitle1:Title="myTitle1 ";break ;