看了风铃的文章,原来自定义的属性除了TextBox ,还有CheckBox和ComboBox ,一共3种类型,我把这些发出来,大家一起分享

第一种:

        string name;
        [WebBrowsable, Category(
"用户控件设置"),
       DefaultValue(
10),
        Personalizable(),
      FriendlyName(
"条数"), Description("请输入显示条数")]
        
public String windbell
        
{
            
get
            
{
                
return name; 
            }

            
set
            
{

            }

        }



第二种:

       private bool _boolField;
        [WebBrowsable(
true), Personalizable(true)]
        
public bool BoolField
        
{
            
get return this._boolField; }
            
set this._boolField = value; }
        }



第三种:

  public enum Days
        
{
            Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday
        }

        
private Days _enumField;
        [WebBrowsable(
true), Personalizable(true)]
        
public Days EnumField
        
{
            
get return this._enumField; }
            
set this._enumField = value; }
        }



再一次感谢风铃,呵呵

posted on 2009-04-16 13:48  寂寞的DBOY  阅读(293)  评论(0编辑  收藏  举报