c# 设置属性的样式(选择文件)

自定义控件的属性样式要设置选择文件样式和选择颜色下拉相似.实现的特性为

[UrlProperty("*.aspx")]//文件类型选择

[Editor("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]//版本控件

 

         private   string   _postBackUrl 
        [UrlProperty(
" *.aspx " )]
        [DefaultValue(
"" )]
        [Themeable(
false )]
        [Editor(
" System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral,  PublicKeyToken=b03f5f7f11d50a3a " typeof (UITypeEditor))]
        
public   string  PostBackUrl 
        

           
get
            
{
                
return _postBackUrl ;
            }

            
set
            
{
                _postBackUrl 
= value;
            }
     
      }
上面的例子是选择以.aspx结尾的文件!

你可能感兴趣的:(c# 设置属性的样式(选择文件))