在控件中定義枚舉類型的屬性
public enum dtablestateselect
{
showaddnew = 1,
saveaddnew = 2,
showedit = 3,
saveedit = 4,
delete = 5,
show = 6,
list = 0
}
private dtablestateselect _dtablestate; //定義類的私有變量,變量的類型為上面定義的枚舉
public dtablestateselect dtablestate //定義屬性,變量的類型為上面定義的枚舉
{
get
{
return _dtablestate;
}
set
{
_dtablestate = value;
}
}
在頁面設置控件的枚舉類屬性
dtable1.dtablestate = dtablecontrol.dtable.dtablestateselect.list;
當然,也可以在設計界面的屬性欄直接選擇屬性的不同類型
新聞熱點
疑難解答