Today, I saw a message from a netizen: I would like to ask the brothers, and how to inherit the existing components in Microsoft .NET Framework, how to block some attributes, is the new component does not provide inheritance, such as inheriting PANEL Newly written EPANEL, how to block the backcolor for the PANEL's attribute? ? This problem workaround is as follows: Step 1: Define the design of the service in your control class [Designer (msplus.web.ui.design.webcontrols.buttondesigner)]
[Description
"
Msplus WebControl Button
"
)] [Designer
Typeof
(Msplus.web.ui.design.webcontrols.buttondesigner)]]]
public
SeaD
Class
Button: MsplusWebControl, iPostBackeventhandler
{}
Step 2: Add a design-time service class, this class inherits system.web.ui.design.ControlDesigner Step 3: Rewote the postfilterProperties () method, allowing the designer to change or remove items from the attribute exposed by TypedScriptor .
/ ** /
/ ** * namespace: MSPlus.Web.UI.Design.WebControls * Class: ButtonDesigner * * Author: Mack.Z * Completion Date: 2003-12-21 * Copyright Information: MSLULU (2000.10.10) ** /
Using
System;
Using
System.componentmodel;
Using
System.componentmodel.design;
Using
System.collections;
Namespace
Msplus.web.ui.design.webcontrols
{/ ** ////
Author Blog:
http://blog.9cbs.net/mack_zhu/