Compartilhar via


Calendar.CaptionAlign Propriedade

Definição

Obtém ou define o alinhamento do texto renderizado como uma legenda para o calendário.

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 da propriedade

TableCaptionAlign

Um valor TableCaptionAlign que indica o alinhamento da legenda.

Exceções

O valor especificado não é um dos valores TableCaptionAlign.

Exemplos

O exemplo de código a seguir demonstra como usar a CaptionAlign propriedade para alinhar uma legenda para um Calendar controle.

<%@ 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>

Comentários

Essa propriedade determina onde a legenda aparece em relação ao Calendar controle. O valor padrão é NotSet, que permite que o navegador determine onde alinhar a legenda. A tabela a seguir explica a relação entre o TableCaptionAlign valor e a aparência da legenda.

TableCaptionAlign valor Aparência
Bottom A legenda aparece na parte inferior do calendário, com o texto centralizado.
Left A legenda aparece na parte superior do calendário, com o texto alinhado à esquerda.
NotSet O alinhamento da legenda não está definido e é determinado pelo navegador.
Right A legenda aparece na parte superior do calendário, com o texto alinhado à direita.
Top A legenda aparece na parte superior do calendário com o texto centralizado.

Aplica-se a

Confira também