Compartir vía


Calendar.CaptionAlign Propiedad

Definición

Obtiene o establece la alineación del texto que se representa como un título para el calendario.

public:
 virtual property System::Web::UI::WebControls::TableCaptionAlign CaptionAlign { System::Web::UI::WebControls::TableCaptionAlign get(); void set(System::Web::UI::WebControls::TableCaptionAlign value); };
public virtual System.Web.UI.WebControls.TableCaptionAlign CaptionAlign { get; set; }
member this.CaptionAlign : System.Web.UI.WebControls.TableCaptionAlign with get, set
Public Overridable Property CaptionAlign As TableCaptionAlign

Valor de propiedad

Valor TableCaptionAlign que indica la alineación del título.

Excepciones

El valor especificado no es uno de los TableCaptionAlign valores.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar la CaptionAlign propiedad para alinear un título de un Calendar control.

<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title> Calendar Caption and Caption Align Example </title>
</head>
<body>

   <form id="form1" runat="server">
  
      <h3> Calendar Caption and Caption Align Example </h3>

      <br /><br /> 
  
      <asp:Calendar id="Calendar1"
           ShowGridLines="True" 
           ShowTitle="True"
            Caption="This calendar is used to demonstrate a calendar caption. It also shows
            how the caption can be aligned to the calendar, in this case to the right edge of
            the calendar."
            CaptionAlign="right"  
           runat="server"/>

      <br /><br />

   </form>

</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>

<!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> Calendar Caption and Caption Align Example </title>
</head>
<body>

   <form id="form1" runat="server">
  
      <h3> Calendar Caption and Caption Align Example </h3>

      <br /><br /> 
  
      <asp:Calendar id="Calendar1"
           ShowGridLines="True" 
           ShowTitle="True"
            Caption="This calendar is used to demonstrate a calendar caption. It also shows
            how the caption can be aligned to the calendar, in this case to the right edge of
            the calendar."
            CaptionAlign="right"  
           runat="server"/>

      <br /><br />

   </form>

</body>
</html>

Comentarios

Esta propiedad determina dónde aparece el título en relación con el Calendar control . El valor predeterminado es NotSet, que permite al explorador determinar dónde alinear el título. En la tabla siguiente se explica la relación entre el TableCaptionAlign valor y la apariencia del título.

Valor de TableCaptionAlign Aspecto
Bottom El título aparece en la parte inferior del calendario, con el texto centrado.
Left El título aparece en la parte superior del calendario, con el texto alineado a la izquierda.
NotSet La alineación del título no está establecida y viene determinada por el explorador.
Right El título aparece en la parte superior del calendario, con el texto alineado a la derecha.
Top El título aparece en la parte superior del calendario con el texto centrado.

Se aplica a

Consulte también