Share via


Calendar.CaptionAlign Propriété

Définition

Obtient ou définit l'alignement du texte qui est restitué en tant que légende pour le calendrier.

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

Valeur de propriété

TableCaptionAlign

Valeur TableCaptionAlign qui indique l'alignement de la légende.

Exceptions

La valeur spécifiée n'est pas l'une des valeurs TableCaptionAlign.

Exemples

L’exemple de code suivant montre comment utiliser la CaptionAlign propriété pour aligner une légende pour un Calendar contrôle.

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

Remarques

Cette propriété détermine où la légende apparaît par rapport au Calendar contrôle. La valeur par défaut est NotSet, ce qui permet au navigateur de déterminer où aligner la légende. Le tableau suivant explique la relation entre la TableCaptionAlign valeur et l’apparence de la légende.

Valeur TableCaptionAlign Apparence
Bottom La légende s’affiche en bas du calendrier, avec le texte centré.
Left La légende s’affiche en haut du calendrier, avec le texte aligné à gauche.
NotSet L’alignement des légendes n’est pas défini et est déterminé par le navigateur.
Right La légende s’affiche en haut du calendrier, avec le texte aligné à droite.
Top La légende apparaît en haut du calendrier avec le texte centré.

S’applique à

Voir aussi