扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:金属边缘 来源:天极开发 2007年11月6日
关键字: Windows
using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebControlLibrary{ [DefaultProperty("Text")] [ToolboxData("<{0}:WebCustomControl runat=server></{0}:WebCustomControl>")] public class WebCustomControl : Table { //创建构造函数 public WebCustomControl() { base.Caption = "工作安排列表"; base.CellSpacing = 0; } // 重写CellSpacing属性 [ Bindable(false), Browsable(false), DefaultValue(0) ] public override int CellSpacing { get { return base.CellSpacing; } set { throw new NotSupportedException("不能设置CellSpacing属性."); } } //重写Caption属性 [DefaultValue("工作安排列表")] public override string Caption { get { return base.Caption; } set { base.Caption = value; } } } } |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register TagPrefix="wcc" Namespace="WebControlLibrary" Assembly="WebControlLibrary" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>重写样式属性</title> </head> <body> <form id="form1" runat="server"> <div> <wcc:WebCustomControl ID="demo1" runat="server" Font-Size="small" BorderWidth="1px" CellPadding="4" BorderColor="black" GridLines="both"> <asp:TableRow> <asp:TableCell font-bold="True" runat="server">工作项目</asp:TableCell> <asp:TableCell font-bold="True" runat="server">截至日期</asp:TableCell> <asp:TableCell font-bold="True" runat="server">备注</asp:TableCell> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server">工作1</asp:TableCell> <asp:TableCell runat="server">7月17日</asp:TableCell> <asp:TableCell runat="server">备注内容</asp:TableCell> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server">工作2</asp:TableCell> <asp:TableCell runat="server">7月27日</asp:TableCell> <asp:TableCell runat="server">备注内容</asp:TableCell> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server">工作3</asp:TableCell> <asp:TableCell runat="server">7月29日</asp:TableCell> <asp:TableCell runat="server">备注内容</asp:TableCell> </asp:TableRow> </wcc:WebCustomControl> </div> </form> </body> </html> |
![]() |
濠电姷顣介埀顒€鍟块埀顒€缍婇幃妯诲緞閹邦剛鐣洪梺闈浥堥弲婊勬叏濠婂牊鍋ㄦい鏍ㄧ〒閹藉啴鏌熼悜鈺傛珚鐎规洘宀稿畷鍫曞煛閸屾粍娈搁梻浣筋嚃閸ㄤ即宕㈤弽顐ュС闁挎稑瀚崰鍡樸亜閵堝懎濮┑鈽嗗亝濠㈡ê螞濡ゅ懏鍋傛繛鍡樻尭鐎氬鏌嶈閸撶喎顕i渚婄矗濞撴埃鍋撻柣娑欐崌閺屾稑鈹戦崨顕呮▊缂備焦顨呴惌鍌炵嵁鎼淬劌鐒垫い鎺戝鐎氬銇勯弽銊ф噥缂佽妫濋弻鐔碱敇瑜嶉悘鑼磼鏉堛劎绠為柡灞芥喘閺佹劙宕熼鐘虫緰闂佽崵濮抽梽宥夊垂閽樺)锝夊礋椤栨稑娈滈梺纭呮硾椤洟鍩€椤掆偓閿曪妇妲愰弮鍫濈闁绘劕寮Δ鍛厸闁割偒鍋勯悘锕傛煕鐎n偆澧紒鍌涘笧閹瑰嫰鎼圭憴鍕靛晥闂備礁鎼€氱兘宕归柆宥呯;鐎广儱顦伴崕宥夋煕閺囥劌澧ù鐘趁湁闁挎繂妫楅埢鏇㈡煃瑜滈崜姘跺蓟閵娧勵偨闁绘劕顕埢鏇㈡倵閿濆倹娅囨い蹇涗憾閺屾洟宕遍鐔奉伓
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者