WebControl.ForeColor (Propiedad)
Ensamblado: System.Web (en system.web.dll)
[TypeConverterAttribute(typeof(WebColorConverter))] public virtual Color ForeColor { get; set; }
/** @property */ public Color get_ForeColor () /** @property */ public void set_ForeColor (Color value)
public function get ForeColor () : Color public function set ForeColor (value : Color)
Valor de propiedad
Color que representa el color de primer plano del control. El valor predeterminado es Empty.Utilice la propiedad ForeColor para especificar el color de primer plano del control de servidor Web. El color de primer plano suele ser el color del texto. Esta propiedad se representa en exploradores anteriores a la versión 4 de Microsoft Internet Explorer para todos los controles, excepto Image, AdRotator, HyperLink y LinkButton.
Nota: |
|---|
| En los exploradores anteriores a la versión 4 de Microsoft Internet Explorer, esta propiedad se representa en forma de etiquetas <font>. |
En el ejemplo siguiente se muestra cómo establecer la propiedad ForeColor del control Table, que se hereda de la clase base WebControl.
<%@ Page Language="C#" AutoEventWireup="True" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Table Property</title> </head> <body> <form id="form1" runat="server"> <div> <h3>Property of a Table Web Control</h3> <asp:Table id="Table1" runat="server" CellPadding = "10" CellSpacing="0" GridLines="Both" Font-Bold="true" ForeColor="Red"> <asp:TableRow> <asp:TableCell> Row 0, Col 0 </asp:TableCell> <asp:TableCell> Row 0, Col 1 </asp:TableCell> </asp:TableRow> <asp:TableRow> <asp:TableCell> Row 1, Col 0 </asp:TableCell> <asp:TableCell> Row 1, Col 1 </asp:TableCell> </asp:TableRow> </asp:Table> </div> </form> </body> </html>
Windows 98, Windows 2000 Service Pack 4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Mobile para Smartphone, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter
Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.
Nota: