如何使用颜色,字体粗体,字体大小等为TextField提供样式,如TextField和label,并且日期格式不是显示字段上的精确显示。它与数据库中的时间偶数列相结合只是日期类型 样品:
<ext:Toolbar Dock="Top" ID="toolBar" runat="server">
<Items>
<ext:DisplayField ID="DisplayField4" runat="server" FieldLabel="Message From" LabelSeparator="" Name="FromName" />
<ext:ToolbarSpacer runat="server" Width="25" />
<ext:DisplayField ID="DisplayField2" runat="server" Name="DueDate" FieldLabel="Due Date" LabelSeparator="" LabelWidth="60" />
<ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="25" />
<ext:Label runat="server" Text="Days Remaining" StyleSpec="color:red" />
</Items>
</ext:Toolbar>
答案 0 :(得分:0)
我建议使用Cls属性来设置组件样式。
<%@ Page Language="C#" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
<style>
.my-displayfield1 .x-form-display-field {
color: yellow;
font-size: large;
}
.my-displayfield2 .x-form-display-field {
color: green;
font-weight: bold;
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:DisplayField runat="server" Cls="my-displayfield1" Text="I am DisplayField #1" />
<ext:DisplayField runat="server" Cls="my-displayfield2" Text="I am DisplayField #2" />
</form>
</body>
</html>