国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

屏蔽.NET自定義開發組件中的屬性

2024-07-10 13:04:55
字體:
來源:轉載
供稿:網友
今天看見一個網友的留言:
有一個問題請教一下兄臺,對于繼承自microsoft的.net framework中現有的組件,怎么將一些屬性屏蔽掉,就是新的組件不提供繼承來的屬性,比如繼承panel新編寫epanel,對于panel的屬性的backcolor怎么屏蔽掉??

這個問題解決方法如下:

第一步:在你的控件類中定義設計時中提供服務的類
[designer(typeof (msplus.web.ui.design.webcontrols.buttondesigner))]
[description( "msplus webcontrol button" )]
[designer(typeof (msplus.web.ui.design.webcontrols.buttondesigner))]
public sealed class button: mspluswebcontrol, ipostbackeventhandler
{
}
第二步:新增一個設計時服務類,這個類繼承 system.web.ui.design.controldesigner
第三步:重寫postfilterproperties()方法,
允許設計器從通過 typedescriptor 公開的屬性集中更改或移除項。


/**//**
* 命名空間: msplus.web.ui.design.webcontrols
* 類: buttondesigner
*
* 作者: mack.z
* 完成日期: 2003-12-21
* 版權信息: mslulu (2000.10.10)
**/

using system;
using system.componentmodel;
using system.componentmodel.design;
using system.collections;

namespace msplus.web.ui.design.webcontrols
{
/**//// <summary>
/// buttondesigner 的摘要說明。
/// </summary>
public class buttondesigner:system.web.ui.design.controldesigner
{
public buttondesigner()
{
//
// todo: 在此處添加構造函數邏輯
//
}

protected override void postfilterproperties( idictionary properties )
{
properties.remove( "height" );
properties.remove( "backcolor" );
properties.remove( "borderwidth" );
properties.remove( "font" );
properties.remove( "forecolor" );
properties.remove( "tabindex" );
properties.remove( "tooltip" );
properties.remove( "enabled" );
properties.remove( "enableviewstate" );
}

}
}

如果大家有控件開發上的問題,也可以在我的主頁上留言.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高州市| 乌拉特后旗| 绵竹市| 彭阳县| 鄂托克前旗| 马山县| 光山县| 闻喜县| 论坛| 郧西县| 运城市| 青冈县| 县级市| 海林市| 远安县| 兴安县| 望城县| 九寨沟县| 鞍山市| 建水县| 岚皋县| 彭山县| 黑山县| 安西县| 宝丰县| 桃园县| 吴忠市| 福建省| 肥乡县| 唐海县| 博罗县| 柳河县| 甘肃省| 时尚| 阿鲁科尔沁旗| 堆龙德庆县| 都兰县| 旬阳县| 虎林市| 静宁县| 吉安市|